Spectral data classification method for ultraviolet analyzer
By calculating the local relative fluctuation degree and identifying the real peaks, and dynamically adjusting the moving average window size, the problem of inaccurate baseline correction in traditional methods is solved, the absorbance accuracy of spectral data and the accuracy of feature peak recognition is improved, and the analysis efficiency and reliability are improved.
Patent Information
- Application Number
- CN202510845920.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-06-24
AI Technical Summary
When the baseline changes rapidly, the traditional moving average method causes inaccurate baseline correction due to improper selection of window size, which affects the accuracy of the absorbance value of the spectral data, which in turn leads to inaccurate feature peak selection and reduced spectral data classification accuracy.
By calculating the local relative fluctuation degree of each wavelength point, the high fluctuation area is selected and the real peak is identified. Combined with the characteristics of baseline drift and real gas absorption peaks, the moving average window size is dynamically adjusted, baseline correction is performed, and visual display is performed.
It significantly improves the accuracy of the absorbance value of the spectral data, enhances the accuracy of feature peak recognition, and improves the efficiency and reliability of spectral data analysis.
Smart Images

Figure CN120354247A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spectral analysis. In particular, it relates to a spectral data classification method for an ultraviolet analyzer. Background Art
[0002] Ultraviolet analyzers are applied in fields such as chemical analysis, environmental monitoring, and biomedicine, and are used to detect and analyze the absorption spectra of samples. Baseline correction, as a core step in the preprocessing stage, plays a crucial role. However, problems such as baseline drift and noise interference often exist in spectral data, which can affect the accuracy of spectral data and the reliability of subsequent analysis. Traditional baseline correction and feature extraction methods have limitations. For example, the moving average method may smooth out important spectral details, resulting in the misidentification or omission of real peaks.
[0003] One of the conventional baseline correction methods is the moving average method. This method smooths the spectral curve by performing a moving average process on the spectral data, thereby removing high-frequency noise and baseline fluctuations. However, the moving average method has obvious limitations. The selection of the window size for moving average has a significant impact on the correction result. Especially when the baseline changes rapidly, if a larger window is selected, although it can more effectively smooth the baseline fluctuations, it will also smooth out the detailed information of the spectral data, which may lead to inaccurate baseline correction.
[0004] Inaccurate baseline correction will cause deviations in the absorbance values of spectral data. This deviation will directly affect the subsequent selection of characteristic peaks because the accurate identification of characteristic peaks depends on accurate absorbance data. Furthermore, this deviation will also reduce the accuracy of spectral data classification and affect the final analysis result. Summary of the Invention
[0005] To solve the technical problems existing in the baseline correction of the existing moving average method, that is, when the baseline changes rapidly, the inaccurate baseline correction caused by the selection of the window size, which in turn affects the accuracy of the absorbance value of spectral data, resulting in inaccurate selection of characteristic peaks and reduced accuracy of spectral data classification, the present invention provides solutions in the following aspects.
[0006] A spectral data classification method for an ultraviolet analyzer, comprising: acquiring spectral data and performing preprocessing; analyzing the preprocessed spectral data, calculating the local relative fluctuation degree of each wavelength point, calculating the second-order difference between the mean value of the light intensity within the local window of the wavelength point and the mean value of the adjacent window, and performing normalization processing to obtain the probability that each wavelength point belongs to the high-fluctuation region, and screening out the wavelength points belonging to the high-fluctuation region and the corresponding peak-shaped regions according to the probability and a set probability threshold; distinguishing based on the different characteristics of baseline drift and real gas absorption peaks, analyzing the characteristics of the high-fluctuation region, and identifying the probability of the peak-shaped regions belonging to baseline fluctuations and the peak-shaped regions that may be real peaks; measuring the shape matching degree according to the Pearson correlation coefficient between the ideal gas absorption peak model and the normalized peak-shaped vector of the corresponding peak-shaped region, and combining the edge steepness of the peak-shaped region, calculating the probability that the peak-shaped region belongs to a real peak, and judging whether the peak-shaped region is a real peak; dynamically adjusting the window size of the moving average according to the probability that the peak-shaped region belongs to a real peak to achieve more accurate baseline correction, and performing visual display.
[0007] By acquiring spectral data and performing preprocessing, calculating the local relative fluctuation degree of each wavelength point, and screening out the wavelength points belonging to the high-fluctuation region and their corresponding peak-shaped regions. Further distinguishing based on the different characteristics of baseline drift and real gas absorption peaks, and identifying the probability of the peak-shaped regions belonging to baseline fluctuations and the peak-shaped regions that may be real peaks. By combining the shape matching degree and the edge steepness, calculating the probability that the peak-shaped region belongs to a real peak, and dynamically adjusting the window size of the moving average accordingly to achieve more accurate baseline correction. Finally, through visual display, an efficient and accurate spectral data classification method significantly improves the accuracy of the absorbance value of spectral data, enhances the accuracy of characteristic peak identification, and improves the efficiency and reliability of spectral data analysis.
[0008] Preferably, the local relative fluctuation degree includes: Performing a first-order difference on the spectral data, and taking the average value of the absolute values of the first-order difference results of all wavelength points as an index of the overall spectral baseline change rate; Taking any wavelength point as the target wavelength point, taking the wavelength points within the data range on both sides of the target wavelength point as the local window of the target wavelength point, calculating the mean value of the light intensity within the local window of the target wavelength point, and respectively calculating the mean values of the light intensity within the local windows corresponding to the adjacent wavelength points on both sides of the target wavelength point; Calculating the second-order difference between the mean value of the light intensity within the local window of the target wavelength point and the mean value of the adjacent window, and dividing the absolute value of the second-order difference result by the standard deviation of the window corresponding to the target wavelength point for normalization to obtain the local relative fluctuation degree of the target wavelength point.
[0009] By calculating the first-order difference of spectral data, an index of the overall spectral baseline change rate is obtained, thereby quantifying the overall fluctuation degree of the spectral data. Further, taking each wavelength point as the center, the mean value of the light intensity within its local window and the second-order difference of the mean values of adjacent windows are calculated, and the local relative fluctuation degree of each wavelength point is obtained through normalization processing. By effectively identifying the high-fluctuation regions in the spectral data, it provides an important basis for subsequent peak region screening and baseline correction, significantly improving the accuracy and reliability of spectral data analysis.
[0010] Preferably, the probability that the wavelength point belongs to the high-fluctuation region includes: Taking any wavelength point as the target wavelength point, calculate the sum of adding the preset basic sensitivity, global calibration coefficient, and the index of the overall spectral baseline change rate respectively, calculate the ratio of the local relative fluctuation degree of the target wavelength point to the sum multiplied by the scaling factor to obtain the weighted fluctuation index; Use the negative exponential function to perform exponential decay on the weighted fluctuation index, and take the reciprocal of the result after adding 1 to the decayed result to obtain the probability that the target wavelength point belongs to the high-fluctuation region.
[0011] By calculating the weighted fluctuation index of the target wavelength point and using the negative exponential function for exponential decay, the probability that the target wavelength point belongs to the high-fluctuation region is finally obtained. It can not only comprehensively consider the influences of the local relative fluctuation degree, basic sensitivity, global calibration coefficient, and the overall spectral baseline change rate, but also more accurately evaluate the fluctuation significance of each wavelength point, effectively distinguish the high-fluctuation region and the non-high-fluctuation region, and significantly improve the accuracy and reliability of spectral data analysis.
[0012] Preferably, the screening out of the wavelength points belonging to the high-fluctuation region includes: In response to the probability being greater than the preset probability threshold, it is considered that the wavelength point belongs to the high-fluctuation region, and vice versa, if it is less than or equal to the preset probability threshold, it is considered that the wavelength point does not belong to the high-fluctuation region.
[0013] Preferably, obtaining the peak region includes the steps of: Using the density clustering algorithm to cluster the wavelength points belonging to the high-fluctuation region to identify the high-fluctuation region, where the identification condition is: the wavelength point The condition for being able to cluster with the wavelength point is , where, is the spectral resolution; Using the connected component analysis algorithm to connect adjacent high-fluctuation regions to merge adjacent high-fluctuation regions, and further divide the merged high-fluctuation region into independent peak regions.
[0014] By using a density clustering algorithm to cluster the wavelength points belonging to the high-fluctuation region, the high-fluctuation region is identified based on the distance between the wavelength points. Further, a connected component analysis algorithm is used to connect adjacent high-fluctuation regions, and the merged high-fluctuation region is divided into independent peak-shaped regions. It can effectively identify and merge high-fluctuation regions, ensure the integrity and independence of the peak-shaped regions, thereby significantly improving the accuracy and efficiency of spectral data analysis.
[0015] Preferably, the probability of the peak-shaped region that may be a real peak includes: Using a Gaussian function as the ideal gas absorption peak model, denoted as , where represents the wavelength, represents the central wavelength of the peak, represents the width of the peak; Normalize the spectral data within the peak-shaped region to obtain the normalized absorption intensity , and take the Pearson correlation coefficient between the normalized absorption intensity and the ideal Gaussian shape as the shape matching degree; Add 1 to the shape matching degree and then multiply by the weight factor to obtain the normalized shape matching degree, and take the average value of the sum between the normalized shape matching degree and the edge steepness of the peak-shaped region as the probability that the peak-shaped region belongs to a real peak.
[0016] By using a Gaussian function as the ideal gas absorption peak model, normalizing the spectral data within the peak-shaped region, and calculating the Pearson correlation coefficient between the normalized absorption intensity and the ideal Gaussian shape, the shape matching degree is obtained. Further, add 1 to the shape matching degree and then multiply by the weight factor to obtain the normalized shape matching degree, and combine it with the edge steepness of the peak-shaped region to calculate the probability that the peak-shaped region belongs to a real peak. It can comprehensively consider the shape characteristics and edge steepness of the peak-shaped region, more accurately identify real peaks and baseline fluctuations, avoid misidentification, thereby significantly improving the accuracy of characteristic peak selection and providing a more reliable basis for subsequent spectral data classification.
[0017] Preferably, the edge steepness of the peak-shaped region includes: Taking any peak-shaped region as the target peak-shaped region, calculate the radian value of the angle between the peak top and the starting point of the peak-shaped region in the target peak-shaped region to obtain the starting point angle, calculate the radian value of the angle between the peak top and the ending point of the peak-shaped region in the target peak-shaped region to obtain the ending point angle, normalize the starting point angle and the ending point angle respectively, add the normalized angle values and then perform normalization processing to obtain the edge steepness of the target peak-shaped region.
[0018] Preferably, the determination of whether the peak shape region is a real peak includes: If the probability that the peak shape region belongs to a real peak is greater than a preset probability threshold, it is considered that the peak shape region belongs to a real peak; conversely, if it is less than or equal to the preset probability threshold, it is considered that the peak shape region does not belong to a real peak.
[0019] Preferably, the dynamic adjustment of the window size of the moving average includes the steps of: Taking any peak shape region as the target peak shape region, calculating the change range between the preset maximum window size and the preset minimum window size in the target peak shape region; Calculating the probability that the target peak shape region does not belong to a real peak, dividing the probability that it does not belong to a real peak by the preset probability threshold to obtain a normalized result; Adding the product of the change range and the normalized result to the preset minimum window size to obtain the corrected window size of the target peak shape region.
[0020] Preferably, the visual display includes the steps of: Graphically displaying the spectral data after preprocessing and baseline correction, where the horizontal axis is the wavelength and the vertical axis is the absorbance; marking the automatically identified peak shape regions on the spectral data graph, and distinguishing real peaks and non-real peaks with different colors or marks; Based on manual inspection, whether the automatically identified peak shape conforms to the expected gas absorption peak characteristics. For the confirmed characteristic peaks, record the wavelength, absorbance, full width at half maximum, and area parameters, and use them as the characteristic vectors for subsequent classification; Comparing the recorded characteristic peak parameters with the ultraviolet absorption spectral database of known gas molecules to establish a characteristic peak database for subsequent qualitative analysis and multicomponent classification.
[0021] The present invention has the following effects: 1. By dynamically adjusting the window size of the moving average and optimizing the baseline correction process according to the probability that the peak shape region belongs to a real peak, the present invention can significantly improve the accuracy of the absorbance value of the spectral data, not only improving the accuracy of baseline correction, but also enhancing the accuracy of characteristic peak recognition, and improving the efficiency and reliability of spectral data analysis.
[0022] 2. By combining the shape matching degree and the edge steepness to calculate the probability that the peak shape region belongs to a real peak, the present invention can more accurately identify real peaks and baseline fluctuations. It not only considers the shape characteristics of the peak shape region, but also considers the steepness of the edge, can effectively distinguish real peaks and baseline fluctuations, avoid misidentification, is conducive to significantly improving the accuracy of characteristic peak selection, and further improving the accuracy of spectral data classification. Description of the Drawings
[0023] Figure 1It is a flowchart of the method from step S1 to step S5 in a spectral data classification method for an ultraviolet analyzer according to an embodiment of the present invention. Detailed implementation manner
[0024] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments.
[0025] Refer to Figure 1 , a spectral data classification method for an ultraviolet analyzer includes steps S1 to S5, specifically as follows: S1: Obtain spectral data and perform preprocessing.
[0026] Use an ultraviolet light source to irradiate the sample. The substances in the sample absorb the ultraviolet light energy and undergo electronic transitions. Then, photons of a specific wavelength are absorbed, forming absorption peaks. Then, an array CCD detector is used to record the transmitted light intensity to generate two-dimensional spectral data, where one dimension is the wavelength and the other dimension is the light intensity.
[0027] Use methods such as wavelet transform or Kalman filter to remove electronic noise and other interference signals in the spectral data. The above algorithms are all prior arts and will not be elaborated here.
[0028] Furthermore, according to the local fluctuation degree of the spectral data, the baseline fluctuation and the real peak are distinguished, so as to identify the high-fluctuation region, and further judge whether these regions are real peaks. Baseline drift usually shows low-frequency, wide-amplitude, and slow-changing signals, while real gas absorption peaks have the characteristics of high-frequency, narrow-band, and steep change (narrow-band absorption characteristics conforming to Lambert-Beer's law). Identify the high-change region by quantifying the local fluctuation degree, and then verify whether the corresponding peak region is a real peak through the shape matching degree and the edge steepness, ensuring that the real peak is not smoothed.
[0029] S2: Analyze the preprocessed spectral data, calculate the local relative fluctuation degree of each wavelength point, calculate the second-order difference between the mean value of the light intensity in the local window of the wavelength point and the mean value of the adjacent window, and perform normalization processing to obtain the probability that each wavelength point belongs to the high-fluctuation region, and filter out the wavelength points belonging to the high-fluctuation region and the corresponding peak-shaped regions according to the probability and the set probability threshold.
[0030] The local relative fluctuation degree includes: Perform a first-order difference on the spectral data, and take the average value of the absolute values of the first-order difference results of all wavelength points as an index of the overall spectral baseline change rate; Specifically, the index of the overall spectral baseline change rate satisfies the following relational expression: ; In the formula, is an index representing the change rate of the overall spectral baseline, represents the change in light intensity of the spectral data at wavelength , represents the total number of spectral data points.
[0031] That is to say, a larger index of the change rate of the overall spectral baseline reflects a faster overall change of the baseline, and vice versa, it indicates a slower overall change of the baseline.
[0032] Taking any wavelength point as the target wavelength point, the wavelength points within the data range on both sides of the target wavelength point are used as the local window of the target wavelength point, and the mean value of the light intensity within the local window of the target wavelength point is calculated. The mean values of the light intensity within the local windows corresponding to the wavelength points adjacent to both sides of the target wavelength point are calculated respectively; Calculate the second-order difference between the mean value of the light intensity within the local window of the target wavelength point and the mean value of the adjacent window, and divide the absolute value of the second-order difference result by the standard deviation of the window corresponding to the target wavelength point for normalization to obtain the local relative fluctuation degree of the target wavelength point.
[0033] Specifically, the local relative fluctuation degree satisfies the following relational expression: ; In the formula, represents the local relative fluctuation degree of the wavelength point , represents the mean value of the light intensity within the local window centered on the wavelength point , represents the mean value of the light intensity within the local window centered on the wavelength point , represents the mean value of the light intensity within the local window centered on the wavelength point , represents the mean value of the light intensity within the local window centered on the wavelength point ,
[0034] That is to say, by dividing by the standard deviation of the window corresponding to the target wavelength point for normalization, the result is made dimensionless. By calculating the second-order difference between the mean value of the current window and the mean value of the adjacent window, it reflects the acceleration of the mean value change. When the average difference between the average value of the corresponding light intensity within the local window of the wavelength point and the average value of the corresponding light intensity within the respective local windows of the adjacent wavelength points is larger, if the difference between the mean value of the current window and the mean value of the adjacent window is large, it indicates that there is an obvious fluctuation at this position (it may be a peak or a baseline mutation).
[0035] The probability that the wavelength point belongs to the high-fluctuation region includes: Taking any wavelength point as the target wavelength point, the sum of the preset basic sensitivity, global calibration coefficient and overall spectral baseline change rate is calculated, and the ratio between the local relative fluctuation degree of the target wavelength point and the sum is calculated and multiplied by the scaling factor to obtain the weighted fluctuation index; Use a negative exponential function to exponentially decay the weighted volatility index, add 1 to the attenuated result and take the inverse to get the probability that the target wavelength point belongs to the high volatility area.
[0036] Specifically, the probability that a wavelength point belongs to the high fluctuation region satisfies the following relationship: ; In the formula, The wavelength point The probability of belonging to the high volatility area, Indicates wavelength point The local relative fluctuation degree, An indicator of the rate of change of the overall spectral baseline. represents the scaling factor, represents the basic sensitivity, Represents the global calibration coefficient.
[0037] That is, when the local volatility The larger the value, the more drastic the fluctuation of the spectral data. The probability of belonging to the high volatility area is greater. When the overall change is faster, that is, The larger the denominator, The larger the wavelength, the This is because when the overall change is fast, local fluctuations are more likely to be caused by baseline drift rather than characteristic peaks, and vice versa. It is the sigmoid function, which indicates normalization.
[0038] Filter out wavelength points belonging to the high fluctuation area, including: In response to the probability being greater than a preset probability threshold, it is considered that the wavelength point belongs to a high fluctuation region; otherwise, if the probability is less than or equal to the preset probability threshold, it is considered that the wavelength point does not belong to a high fluctuation region.
[0039] Exemplarily, the preset probability threshold is 0.85.
[0040] Further explanation: the high fluctuation area in the spectral data is effectively identified and divided in order to further analyze the real peaks. Specifically, through the density clustering algorithm and the connected domain analysis algorithm, the wavelength points with significant local fluctuations are aggregated into high fluctuation areas, and independent peak areas are further extracted to provide clear structured data for subsequent characteristic peak verification and classification. The specific steps are as follows: Use the density clustering algorithm to cluster the wavelength points belonging to the high-fluctuation region for identifying the high-fluctuation region, where the identification condition is: wavelength points The condition for being able to cluster with wavelength points into one class is , where is the spectral resolution. Exemplarily, .
[0041] In this way, the wavelength points with significant local fluctuations are aggregated into several high-fluctuation regions, where these regions may contain real absorption peaks or baseline fluctuations.
[0042] Use the connected component analysis algorithm to connect adjacent high-fluctuation regions for merging adjacent high-fluctuation regions; further divide the merged high-fluctuation regions into independent peak-shaped regions, and analyze each peak-shaped region to verify whether it is a real peak.
[0043] Through connected component analysis, adjacent high-fluctuation regions are merged into larger regions, thereby reducing fragmented high-fluctuation regions and improving the efficiency and accuracy of subsequent analysis.
[0044] Denote any one peak-shaped region as , where represents the starting wavelength point of the peak-shaped region , represents the ending wavelength point of the peak-shaped region , and analyze with any one peak-shaped region .
[0045] In this way, each peak-shaped region is clearly defined, facilitating subsequent verification and analysis of characteristic peaks. Through features such as shape matching degree and edge steepness, judge whether the peak-shaped region conforms to the characteristics of real peaks (such as high frequency, narrow band, steep change, etc.). Ensure that the peak-shaped regions extracted contain real peaks rather than baseline fluctuations or other noise signals.
[0046] S3: Distinguish based on the different characteristics of baseline drift and real gas absorption peaks, analyze the characteristics of the high-fluctuation region, and identify the probabilities of the peak-shaped regions belonging to baseline fluctuations and the peak-shaped regions that may be real peaks.
[0047] It should be noted that baseline drift refers to the phenomenon that in spectral data, the baseline (i.e., background signal or noise) changes slowly with wavelength or time. This change is usually low-frequency, wide-range, and relatively gentle. Real gas absorption peaks refer to the peaks formed in spectral data due to the absorption of light with specific wavelengths by gas molecules. These peaks usually have specific shapes and positions, conforming to physical and chemical principles.
[0048] In spectral data analysis, it is crucial to distinguish baseline drift from real gas absorption peaks. Baseline drift usually appears as a low-frequency, wide-amplitude, and slowly varying signal, while real gas absorption peaks appear as high-frequency, narrow-band, and steeply varying signals. By analyzing these characteristics, baseline drift and real gas absorption peaks can be effectively distinguished, thereby improving the analysis accuracy of spectral data.
[0049] The Gaussian function is adopted as the ideal gas absorption peak model, denoted as , where represents the wavelength, represents the central wavelength of the peak, represents the width of the peak; Normalize the spectral data within the peak shape region to obtain the normalized absorption intensity . Take the Pearson correlation coefficient between the normalized absorption intensity and the ideal Gaussian shape as the shape matching degree ; Multiply the shape matching degree by the weight factor after adding 1, and take the average of the sum of the normalized shape matching degree and the edge steepness of the peak shape region as the probability that the peak shape region belongs to a real peak.
[0050] Specifically, the probability of belonging to a real peak satisfies the following relationship: ; In the formula, represents the probability that the peak shape region belongs to a real peak, represents the shape matching degree of the peak shape region , represents the edge steepness of the peak shape region , represents the weight factor.
[0051] Exemplarily, the weight factor is 0.5 and can be adjusted according to specific circumstances; since the value of the shape matching degree is between , so the value range becomes , and by multiplying by the weight factor, the value range becomes between.
[0052] Take the Pearson correlation coefficient between the normalized absorption intensity and the ideal Gaussian shape . The Pearson correlation coefficient is a well-known prior art and will not be described in detail here.
[0053] The edge steepness of the peak shape region includes: Taking any peak-shaped region as the target peak-shaped region, calculate the radian value of the angle between the peak top and the starting point of the peak-shaped region in the target peak-shaped region to obtain the starting point angle, calculate the radian value of the angle between the peak top and the ending point of the peak-shaped region in the target peak-shaped region to obtain the ending point angle, normalize the starting point angle and the ending point angle respectively, add the normalized angle values and then perform normalization processing to obtain the edge steepness of the target peak-shaped region.
[0054] Specifically, the edge steepness satisfies the following relational expression: ; In the formula, represents the edge steepness of the peak-shaped region , represents the horizontal distance between the peak top and the starting point of the peak-shaped region, represents the Euclidean distance between the peak top and the starting point of the peak-shaped region, represents the horizontal distance between the peak top and the ending point of the peak-shaped region, represents the Euclidean distance between the peak top and the ending point of the peak-shaped region, represents the arccosine function, represents the normalization function.
[0055] It should be noted that when the steep angle is 90°, it means that the edge of the peak-shaped region is very steep and close to vertical. In this case, the value of the edge steepness will approach its maximum value, indicating that the edge of the peak-shaped region has a very high steepness. Such a highly steep edge usually means that the spectral characteristics of the peak-shaped region are very significant, and it may be a real absorption peak or emission peak, rather than a false peak caused by baseline drift or noise.
[0056] In spectral analysis, real peaks usually have steep edges, while baseline fluctuations are relatively gentle. Therefore, when the steep angle is 90°, this peak-shaped region is more likely to be a real characteristic peak. Such a highly steep edge can be used as an important feature of the characteristic peak for subsequent qualitative analysis and multi-component classification.
[0057] In addition, to evaluate the edge steepness of the peak region, in addition to the method of calculating the angle using the inverse cosine function, the following techniques can also be adopted: First, by calculating the first derivative of the spectral data in the peak region, the slope change of the spectral curve can be obtained. The larger the absolute value of the slope, the steeper the edge. Second, calculating the second derivative of the spectral data can reflect the curvature change of the spectral curve. The larger the absolute value of the curvature, the steeper the edge. Finally, using a gradient operator (such as the Sobel or Prewitt operator) can calculate the edge gradient of the peak region. The larger the magnitude of the gradient, the steeper the edge. These methods each have their own advantages, and appropriate techniques can be selected according to the specific application scenario and data characteristics to evaluate the edge steepness of the peak region.
[0058] S4: Measure the shape matching degree according to the Pearson correlation coefficient between the ideal gas absorption peak model and the normalized peak shape vector of the corresponding peak region, and combine the edge steepness of the peak region to calculate the probability that the peak region belongs to a real peak, and determine whether the peak region is a real peak.
[0059] It should be noted that the ideal gas absorption peak model is a theoretical model based on the vibration and rotational transition principles of ideal gas molecules, used to describe the light absorption characteristics of gas molecules in a specific wavelength band. The formation of absorption peaks is closely related to the quantum energy level transitions of molecules, and its characteristics include center frequency, full width at half maximum, and absorption intensity. These characteristics are affected by factors such as temperature, pressure, and gas composition. This model has a wide range of applications in fields such as spectral analysis, atmospheric remote sensing, and industrial process monitoring. By analyzing the absorption peaks, parameters such as the composition, concentration, and temperature of the gas can be determined, and it is an important tool for studying the interaction between gas molecules and light.
[0060] In response to the probability that the peak region belongs to a real peak being greater than the preset probability threshold, it is considered that the peak region belongs to a real peak. Conversely, if it is less than or equal to the preset probability threshold, it is considered that the peak region does not belong to a real peak.
[0061] Exemplarily, the preset probability threshold is , which can be adjusted according to the specific situation.
[0062] S5: Dynamically adjust the window size of the moving average according to the probability that the peak region belongs to a real peak to achieve more accurate baseline correction and perform visual display.
[0063] Taking any peak region as the target peak region, calculate the change range between the preset maximum window size and the preset minimum window size in the target peak region; Calculate the probability that the target peak region does not belong to a real peak, divide the probability of not belonging to a real peak by the preset probability threshold to obtain the normalized result; Add the product of the variation range and the normalized result to the preset minimum window size to obtain the corrected window size of the target peak region.
[0064] Specifically, the corrected window size satisfies the following relational expression: ; In the formula, represents the peak region the corrected window size, represents the preset minimum window size, represents the preset maximum window size, represents the peak region the probability of belonging to a real peak, represents the preset probability threshold.
[0065] Exemplarily, the preset minimum window size is 3, and the preset maximum window size is 15, which can be adjusted according to actual situations.
[0066] Visual display includes the steps of: Graphically display the preprocessed and baseline-corrected spectral data, where the horizontal axis is the wavelength and the vertical axis is the absorbance; mark the automatically identified peak regions on the spectral data graph, and distinguish real peaks and non-real peaks with different colors or marks; Based on manual inspection, check whether the automatically identified peaks conform to the expected gas absorption peak characteristics. For the confirmed characteristic peaks, record the position (wavelength), intensity (absorbance), full width at half maximum, and area parameters, and use them as the characteristic vectors for subsequent classification; Compare the recorded characteristic peak parameters with the ultraviolet absorption spectral database of known gas molecules to establish a characteristic peak database for subsequent qualitative analysis and multicomponent classification.
[0067] Exemplarily, three peak regions are automatically identified , and after manual verification, it is confirmed that is a real peak, is a non-real peak. Record the characteristic parameters of and compare them with the absorption peaks of known gas molecules to finally determine the gas components and their concentrations contained in the sample.
[0068] It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several deformations and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of this invention patent shall be subject to the appended claims.
Claims
1. A spectral data classification method for an ultraviolet analyzer, characterized in that, Including: Obtain spectral data and perform preprocessing; Analyze the preprocessed spectral data, calculate the local relative fluctuation degree at each wavelength point, calculate the second-order difference between the mean value of the light intensity within the local window of the wavelength point and the mean value of the adjacent window, and perform normalization processing to obtain the probability that each wavelength point belongs to the high-fluctuation region, and screen out the wavelength points belonging to the high-fluctuation region and the corresponding peak-shaped regions according to the probability and the set probability threshold; Distinguish based on the different characteristics of baseline drift and real gas absorption peaks, analyze the characteristics of the high-fluctuation region, and identify the probability of the peak-shaped region belonging to baseline fluctuation and the peak-shaped region that may be a real peak; Measure the shape matching degree according to the Pearson correlation coefficient between the ideal gas absorption peak model and the normalized peak shape vector of the corresponding peak-shaped region, and combine the edge steepness of the peak-shaped region to calculate the probability that the peak-shaped region belongs to a real peak, and judge whether the peak-shaped region is a real peak; Dynamically adjust the window size of the moving average according to the probability that the peak-shaped region belongs to a real peak to achieve more accurate baseline correction, and perform visual display.
2. The spectral data classification method for an ultraviolet analyzer according to claim 1, wherein The local relative fluctuation degree includes: Perform a first-order difference on the spectral data, and use the average value of the absolute values of the first-order difference results of all wavelength points as an index of the overall spectral baseline change rate; Take any wavelength point as the target wavelength point, and use the wavelength points within the data range on both sides of the target wavelength point as the local window of the target wavelength point, calculate the mean value of the light intensity within the local window of the target wavelength point, and calculate the mean values of the light intensity within the local windows corresponding to the wavelength points adjacent to both sides of the target wavelength point respectively; Calculate the second-order difference between the mean value of the light intensity within the local window of the target wavelength point and the mean value of the adjacent window, and calculate the absolute value of the second-order difference result divided by the standard deviation of the window corresponding to the target wavelength point for normalization to obtain the local relative fluctuation degree of the target wavelength point.
3. A spectral data classification method for an ultraviolet analyzer according to claim 1, characterized in that, The probability that the wavelength point belongs to the high-fluctuation region includes: Take any wavelength point as the target wavelength point, calculate the sum of the preset basic sensitivity, global calibration coefficient, and the index of the overall spectral baseline change rate respectively, calculate the ratio of the local relative fluctuation degree of the target wavelength point to the sum multiplied by the scaling factor to obtain the weighted fluctuation index; Use the negative exponential function to perform exponential decay on the weighted fluctuation index, and take the reciprocal of the result after adding 1 to the decay result to obtain the probability that the target wavelength point belongs to the high-fluctuation region.
4. A spectral data classification method for an ultraviolet analyzer according to claim 1, characterized in that, The screening out of the wavelength points belonging to the high-fluctuation region includes: In response to the probability being greater than the preset probability threshold, it is considered that the wavelength point belongs to the high-fluctuation region, otherwise less than or equal to the preset probability threshold, it is considered that the wavelength point does not belong to the high-fluctuation region.
5. A spectral data classification method for an ultraviolet analyzer according to claim 1, characterized in that, Obtaining the peak-shaped region includes the steps of: The density clustering algorithm is used to cluster the wavelength points belonging to the high-fluctuation region for identifying the high-fluctuation region, where the identification condition is: wavelength points The condition for being able to cluster into a class with wavelength points is , where is the spectral resolution; Use the connected component analysis algorithm to connect adjacent high-fluctuation regions to merge adjacent high-fluctuation regions, and further divide the merged high-fluctuation regions into independent peak-shaped regions.
6. A spectral data classification method for an ultraviolet analyzer according to claim 1, characterized in that, The probability of the peak-shaped region that may be a real peak includes: The Gaussian function is adopted as the ideal gas absorption peak model, denoted as , where represents the wavelength, represents the central wavelength of the peak, represents the width of the peak; For the peak-shaped region Normalize the spectral data within to obtain the normalized absorption intensity , and use the Pearson correlation coefficient between the normalized absorption intensity and the ideal Gaussian shape as the shape matching degree; Add 1 to the shape matching degree and then multiply by the weight factor to obtain the normalized shape matching degree, and take the average value of the sum between the normalized shape matching degree and the edge steepness of the peak-shaped region as the probability that the peak-shaped region belongs to a real peak.
7. A spectral data classification method for an ultraviolet analyzer according to claim 6, characterized in that, The edge steepness of the peak-shaped region includes: Taking any peak-shaped region as the target peak-shaped region, calculating the radian value of the angle between the peak top and the starting point of the peak-shaped region in the target peak-shaped region to obtain the starting point angle, calculating the radian value of the angle between the peak top and the ending point of the peak-shaped region in the target peak-shaped region to obtain the ending point angle, normalizing the starting point angle and the ending point angle respectively, adding the normalized angle values and then performing normalization processing to obtain the edge steepness of the target peak-shaped region.
8. A spectral data classification method for an ultraviolet analyzer according to claim 1, characterized in that, The determination of whether the peak-shaped region is a real peak includes: In response to the probability that the peak-shaped region belongs to a real peak being greater than the preset probability threshold, it is considered that the peak-shaped region belongs to a real peak; otherwise, if it is less than or equal to the preset probability threshold, it is considered that the peak-shaped region does not belong to a real peak.
9. A spectral data classification method for an ultraviolet analyzer according to claim 1, characterized in that, The dynamic adjustment of the window size of the moving average includes the steps of: Taking any peak-shaped region as the target peak-shaped region, calculating the change range between the preset maximum window size and the preset minimum window size in the target peak-shaped region; Calculating the probability that the target peak-shaped region does not belong to a real peak, dividing the probability that it does not belong to a real peak by the preset probability threshold to obtain the normalized result; Adding the product between the change range and the normalized result to the preset minimum window size to obtain the corrected window size of the target peak-shaped region.
10. A spectral data classification method for an ultraviolet analyzer according to claim 1, characterized in that, The visualization display includes the steps of: Displaying the preprocessed and baseline-corrected spectral data graphically, where the horizontal axis is the wavelength and the vertical axis is the absorbance; marking the automatically identified peak-shaped regions on the spectral data graph, and distinguishing real peaks and non-real peaks with different colors or markings; Based on manual inspection of whether the automatically identified peaks conform to the expected gas absorption peak characteristics, for the confirmed characteristic peaks, recording the wavelength, absorbance, full width at half maximum, and area parameters, and using them as the feature vectors for subsequent classification; Comparing the recorded characteristic peak parameters with the ultraviolet absorption spectral database of known gas molecules to establish a characteristic peak database for subsequent qualitative analysis and multi-component classification.
Citation Information
Patent Citations
Method for carrying out adaptive baseline correction and peak identification on chromatogram
CN117434195A
Nitrogen and sulfur in-situ measurement method and system based on differential ultraviolet spectrum technology
CN118032695A
High-voltage cable fault early warning method and system based on laser absorption spectrum
CN118625055A
Food pesticide residue detection system and method
CN119198665A
Method and system for detecting moisture content of petroleum product based on near infrared spectrum
CN120009225A