Raman spectrum characteristic peak segmentation method based on distance vector and probability vector output
By using a Raman spectral characteristic peak segmentation method based on distance and probability vectors, the problem of expressing the hierarchical relationship between shoulder peaks and sub-peaks in existing technologies is solved. This method achieves accurate segmentation and hierarchical labeling of the main peak, shoulder peaks, and sub-peaks, thereby improving the efficiency and accuracy of analysis.
Patent Information
- Application Number
- CN202511419065.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-09-30
AI Technical Summary
Existing Raman spectroscopy peak segmentation methods struggle to effectively express the hierarchical relationship between shoulder peaks, sub-peaks, and main peaks when dealing with multi-level peak structures. This leads to the loss of key feature information and inaccurate molecular fingerprint identification, resulting in high false positive and false negative rates, especially in the analysis of complex samples.
A method based on distance vector and probability vector output is adopted. Through multi-scale wavelet decomposition, local curvature change rate calculation, adaptive distance calculation kernel function and deep neural network, a joint segmentation decision function is constructed to achieve accurate segmentation and hierarchical labeling of main peak, shoulder peak and sub-peak.
It improves the ability to distinguish overlapping peak regions, reduces the false positive and false negative rates, ensures the reliable identification of weak features, enhances analysis efficiency and objectivity, and adapts to various complex peak shapes without human intervention.
Smart Images

Figure CN120892805B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of spectral analysis, more particularly, the present application relates to a Raman spectrum characteristic peak segmentation method based on distance vector and probability vector output. BACKGROUND
[0002] As a non-destructive molecular structure characterization method, Raman spectroscopy is widely used in material science, biomedical, drug development, environmental monitoring and food safety fields. Based on the principle of non-elastic scattering of molecular vibration and rotation energy level, it can provide the "fingerprint spectrum" of the molecular structure of the substance, and realize the qualitative and quantitative analysis of the sample composition. However, the accurate analysis of Raman spectrum depends on the accurate identification and segmentation of the characteristic peaks in the spectrum curve, especially in the analysis of complex samples, the extraction and processing of spectral peaks directly affect the reliability of the subsequent analysis results.
[0003] The existing Raman spectrum characteristic peak segmentation method has defects in processing multi-level peak structure, especially the hierarchical relationship between shoulder peak, sub-peak and main peak cannot be effectively expressed and accurately segmented by a single distance vector. In the analysis of complex molecules such as protein structure, multi-component drug preparation or semiconductor material, the traditional algorithm often incorrectly combines the shoulder peak into the main peak or completely ignores it, resulting in the loss of key feature information; at the same time, the low-intensity sub-peak is often misjudged as noise or background fluctuation and filtered out, which seriously affects the accuracy of molecular fingerprint identification. For example, in the Raman analysis of carbon nanomaterials, the overlapping region of G peak and D' peak, the 2D peak multi-component structure in graphene, and the complex structure of protein amide I band in biological samples all show a complex hierarchical relationship of main peak-shoulder peak-sub-peak, and the existing methods based on single distance measurement or threshold segmentation cannot capture this hierarchical dependency, resulting in peak assignment errors and spectrum interpretation bias. Especially when the sample is in a chemical environment change, phase change process or contains trace impurities, the secondary peak characteristics often carry the most critical change information, and the shortcomings of the existing technology directly limit the fine application potential of Raman spectrum in material science, drug development and biomedical fields. The equal weight distance vector commonly used in existing algorithms cannot adapt to the width change of the main peak and the fine features of the sub-peak, and cannot express the subordinate relationship between the shoulder peak and the main peak, resulting in systematic errors in molecular structure analysis and component quantitative analysis.
[0004] In view of this, the present application proposes a Raman spectrum characteristic peak segmentation method based on distance vector and probability vector output to solve the above problems. SUMMARY
[0005] In order to overcome the above-mentioned defects of the prior art, in order to achieve the above-mentioned purpose, the present application provides the following technical scheme: a Raman spectrum characteristic peak segmentation method based on distance vector and probability vector output, comprising:
[0006] Obtain the original intensity sequence data of the Raman spectrum to be analyzed, and preprocess the original intensity sequence data to obtain a standardized spectrum sequence;
[0007] Perform multi-scale wavelet decomposition on the standardized spectrum sequence, extract spectral detail features under different frequency components, and construct a spectrum multi-level structure representation matrix;
[0008] Based on the spectrum multi-level structure representation matrix, the potential peak sites and their hierarchical attribution relationship are identified by local curvature change rate calculation in a sliding window;
[0009] For each potential peak site, a neighborhood topology centered on the site is constructed, and the asymmetry index and peak shape complexity coefficient in the neighborhood are calculated;
[0010] According to the asymmetry index and the peak shape complexity coefficient, an adaptive distance calculation kernel function is generated, which is used to process the differentiated boundary features of shoulder peaks, sub-peaks and main peaks;
[0011] Based on the adaptive distance calculation kernel function, the weighted distance of each spectrum point to its left and right effective valley is calculated, and a hierarchical perception distance vector is generated;
[0012] The standardized spectrum sequence is extracted by a deep neural network, and an initial probability vector is output, and the hierarchical perception distance vector is combined for probability distribution correction;
[0013] According to the corrected probability vector and the hierarchical perception distance vector, a joint segmentation decision function of multi-level peak structure is constructed;
[0014] Based on the joint segmentation decision function, the accurate segmentation and hierarchical labeling of main peaks, shoulder peaks and sub-peaks in the Raman spectrum are realized.
[0015] The technical effects and advantages of the Raman spectrum feature peak segmentation method based on the distance vector and the probability vector output by the present application are as follows:
[0016] The present application can accurately distinguish the hierarchical relationship between main peaks, shoulder peaks and sub-peaks, so that the secondary features previously ignored or incorrectly combined can be accurately identified, thereby retaining the complete information in the spectrum. Through the hierarchical perception structured processing framework, the resolution of the overlapping peak region is greatly improved, so that the weak shoulder peak hidden in the edge of the main peak and the sub-peak with lower intensity can be reliably identified. Especially under low signal-to-noise ratio conditions, the present application effectively reduces the false positive rate and the false negative rate, ensuring that weak features are not masked or misjudged by noise. In addition, the high adaptability of the present application can intelligently cope with various complex peak shapes, automatically adjust the processing strategy without human intervention, and greatly improve the analysis efficiency and objectivity. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 Figure 1 is a schematic diagram of the Raman spectrum characteristic peak segmentation method based on distance vector and probability vector output of the present application;
[0018] Figure 2 Figure 2 is a schematic diagram of the feature peak region mask of the present application;
[0019] Figure 3 Figure 3 is a schematic diagram of the final segmentation effect of the present application. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.
[0021] The present application provides a Raman spectrum characteristic peak segmentation method based on distance vector and probability vector output. The execution subject of the method includes but is not limited to: a spectrum analysis device, a spectrum data processing system, a spectrum feature recognition device, an intelligent spectrum analysis terminal, etc., which can be regarded as a general computing node of the present application, and the spectrum data processing system includes but is not limited to: a spectrum signal processor, a distributed spectrum analysis system, and at least one programmable spectrum analysis controller.
[0022] In the embodiments of the present application, the detailed implementation steps of the Raman spectrum characteristic peak segmentation method based on distance vector and probability vector output include:
[0023] The original intensity sequence data of the Raman spectrum to be analyzed is obtained, and the original intensity sequence data is preprocessed to obtain a standardized spectrum sequence. The original intensity sequence data includes Raman shift (wavenumber) and its corresponding scattering intensity value, which is obtained by spectrum instrument acquisition. The preprocessing steps include baseline correction, smoothing and denoising, and intensity normalization, wherein the baseline correction uses a polynomial fitting or wavelet transform method to eliminate fluorescence background interference, the smoothing and denoising uses a Savitzky-Golay filtering algorithm to retain peak shape characteristics while suppressing high-frequency noise, and the intensity normalization maps the spectrum intensity to the [0, 1] interval to ensure comparability between different spectra. These preprocessing steps ensure the accuracy and reliability of subsequent analysis.
[0024] Multi-scale wavelet decomposition is performed on standardized spectral sequences to extract spectral detail features at different frequency components, constructing a multi-level spectral structure representation matrix. Multi-scale wavelet decomposition employs discrete wavelet transform technology, using wavelet basis functions with different scale parameters to decompose the standardized spectral sequences, extracting high-frequency detail features and low-frequency approximation features. Decomposition typically uses orthogonal wavelet bases such as Daubechies or Symlet, and the number of decomposition levels is determined based on spectral complexity, generally 3-5 levels. The detail coefficients and approximation coefficients generated at each decomposition level form the multi-level spectral structure representation matrix. This matrix contains complete feature information of the spectrum at different frequency scales, providing a multi-scale analysis basis for subsequent peak point identification.
[0025] Based on the spectral multi-level structure characterization matrix, potential peak sites and their hierarchical affiliations are identified by calculating the rate of change of local curvature within a sliding window. For example... Figure 2 As shown, this is a schematic diagram of the characteristic peak region mask generated based on the potential peak site identification results (1 represents the characteristic peak region, and 0 represents other regions). This step involves setting an adaptive sliding window at different scale levels, calculating the second derivative sequence within the window, extracting the sign change points as candidate peak sites, and calculating their significance scores. The hierarchical type is determined based on the distribution pattern of the significance scores at each scale level. A hierarchy map of peak sites at different levels is established through cross-scale correlation analysis to determine the hierarchical affiliation of potential peak sites.
[0026] For each potential peak location, a neighborhood topology centered on that point is constructed, and the asymmetry index and peak shape complexity coefficient within that neighborhood are calculated. This step first dynamically determines the neighborhood radius based on the peak location's hierarchical type. Within the determined neighborhood, the area integral of the spectral curves for the left and right intervals is calculated separately. The asymmetry index is calculated by the ratio of the difference between the left and right areas to the sum of their areas. The peak shape complexity coefficient is then determined through higher-order derivative zero-point statistics and inflection point distribution analysis. Finally, these indices are normalized to provide accurate feature parameters for subsequent kernel function generation.
[0027] Based on the asymmetry index and peak shape complexity coefficient, an adaptive distance calculation kernel function is generated to handle the differentiated boundary features of shoulder peaks, sub-peaks, and main peaks. This step identifies the peak skew direction through the asymmetry index, constructs a directional weighted gradient field, converts the peak shape complexity coefficient into an adaptive window scale parameter, constructs a distance sensitivity decay function, generates differentiated spatial influence domains for peak locations of different levels, performs anisotropic diffusion and boundary constraint optimization, and finally generates the adaptive distance calculation kernel function through variational global optimization, enabling it to effectively handle peak boundary features in complex spectra.
[0028] Based on the adaptive distance calculation kernel function, the weighted distance of each spectral point to its left and right effective trough is calculated, and the hierarchical perception distance vector is generated. This step identifies the trough candidate point through local minimum value detection, selects the optimal trough by evaluating its effectiveness score, calculates the weighted distance using the adaptive distance calculation kernel function, and encodes and fuses the weighted distance and the peak position hierarchical information to generate the distance vector containing hierarchical perception information, which provides important spatial structure information for subsequent segmentation decision.
[0029] The standardized spectral sequence is extracted by a deep neural network, and an initial probability vector is output, and the hierarchical perception distance vector is combined to correct the probability distribution. This step constructs a deep neural network containing multiple one-dimensional convolution layers and attention mechanisms, uses skip connection to retain feature information at different abstraction levels, generates an initial probability vector, then sets different probability correction coefficients according to the hierarchical perception distance vector, and obtains the corrected probability vector through point-by-point multiplication operation and local smoothing processing to provide probability estimation of the peak attribute.
[0030] According to the corrected probability vector and the hierarchical perception distance vector, a joint segmentation decision function of multi-level peak structure is constructed. This step performs continuity analysis on the probability vector to identify local maximum points and their influence domain, extracts the directional derivative of the distance vector to calculate the segmentation tendency index, constructs a regional attribution probability transition matrix, generates a probability-distance coupling feature tensor, extracts candidate segmentation lines through singular value decomposition, calculates the energy functional to determine the optimal boundary, constructs a joint segmentation decision function, and realizes accurate identification and segmentation of multi-level peak structure.
[0031] Based on the joint segmentation decision function, the accurate segmentation and hierarchical labeling of the main peak, shoulder peak and sub-peak in the Raman spectrum are realized. This is the final execution step of the whole method, which applies the optimized decision function to the actual spectral data to output the peak attribution label and its confidence of each spectral point, realizes the recursive identification and accurate segmentation of the main peak, shoulder peak and sub-peak through the hierarchical propagation mechanism, and finally generates the analysis results containing complete peak position, boundary, type and hierarchical relationship, which provides an accurate basis for subsequent material identification and quantitative analysis.
[0032] In the embodiment of the application, based on the spectral multi-level structure representation matrix, the detailed implementation steps of identifying potential peak points and their hierarchical attribution relationship include:
[0033] On each scale layer of the spectral multi-level structure representation matrix, an adaptive size sliding window is set. The sliding window is a spatial range for local feature analysis, and its size directly affects the accuracy and sensitivity of peak identification. The setting process adopts an adaptive strategy, and the window size is proportional to the characteristic scale of the current scale layer, which is usually one-third to one-half of the average peak width at this scale. The window size calculation formula is:
[0034] ;
[0035] in, For scale The window size below, For scale The average peak width below This is an adjustment factor, typically ranging from 0.3 to 0.5. Smaller windows are used for lower-scale layers to capture detailed changes, while larger windows are used for higher-scale layers to capture overall trends, ensuring the adaptability and accuracy of the analysis.
[0036] The second derivative sequence of the spectral curve within each sliding window is calculated, and the points of sign change in the second derivative sequence are extracted as candidate peak locations. The second derivative reflects the concavity and convexity of the curve and is an important feature for identifying peaks and troughs. The calculation uses the central difference method, and the formula is:
[0037] ;
[0038] in, Indicates the function at the point The second derivative at a given point. In Raman spectroscopy, the second derivative reflects the concavity and convexity of the spectral curve and is used to identify peaks (negative second derivative) and valleys (positive second derivative). Indicates at point The function value at that point, i.e., the spectral intensity value of the point adjacent to the right of the current point; Indicates at point The function value at that point, i.e., the spectral intensity value of the point adjacent to the left of the current point; Indicates the current point The function value at that point, i.e., the spectral intensity value at the point being analyzed; The sampling interval is typically a fixed interval between adjacent wavenumber points. The sign change point refers to the position where the second derivative changes from positive to negative or from negative to positive, corresponding to the peak and trough, respectively. Threshold filtering is applied during the extraction process to ignore spurious changes caused by minor fluctuations, improving the reliability of the identification.
[0039] For each candidate peak location, its significance score is calculated at different scale levels. The significance score is determined by the ratio of the absolute value of curvature at that point to the average curvature of its neighborhood. The significance score quantifies the prominence of the peak location relative to its surrounding region and is a key indicator for evaluating peak authenticity. The calculation formula is as follows:
[0040] ;
[0041] in, For point In scale The significance score on For point In scale The absolute value of curvature on, For With center radius The average curvature within the neighborhood of the peak. Curvature is calculated using a normalized second derivative expression, independent of spectral intensity, ensuring consistency across scales. A significance score is typically greater than 1; a higher score indicates a more significant peak location.
[0042] Based on the distribution pattern of significance scores across different scales, the hierarchical type of candidate peak sites is determined, including main peak candidate sites, shoulder peak candidate sites, or sub-peak candidate sites. The hierarchical type reflects the peak's performance characteristics in multi-scale space and is the foundation for constructing the hierarchical structure. The determination rule is based on the distribution pattern of significance scores across different scales: main peak candidate sites have high significance scores across multiple scales (typically scores greater than 2.0 in more than 3 scales); shoulder peak candidate sites have moderate significance scores in low-to-medium scales, but their significance decreases in high-scale scales (typically scores greater than 1.5 in 1-2 low-scale scales and less than 1.0 in high-scale scales); sub-peak candidate sites have locally high significance scores only in the lowest scale (typically scores greater than 1.2 only in the lowest scale, with lower scores in other scales). This determination method based on multi-scale analysis can effectively distinguish different types of peak structures.
[0043] Based on the determined hierarchical type, a hierarchy map of peak sites at different levels is established through cross-scale peak site correlation analysis to determine the hierarchical affiliation of potential peak sites. The hierarchy map is a hierarchical representation of the peak structure, describing the dependencies between main peaks, shoulder peaks, and sub-peaks. The construction process first calculates the spatial similarity and intensity correlation between peak sites at adjacent scales, establishes cross-scale connections to form a multi-scale correlation network, identifies main peak nodes that stably exist at multiple scales, and determines shoulder peaks and sub-peaks based on their path relationships with the main peak nodes, ultimately forming a complete hierarchy map. This structured representation provides hierarchical prior knowledge for subsequent segmentation, helping to solve peak overlap and weak signal problems.
[0044] In this embodiment of the invention, for each potential peak point, the detailed implementation steps of constructing a neighborhood topology centered on that point and calculating the asymmetry index and peak shape complexity coefficient within that neighborhood include:
[0045] The neighborhood radius is determined dynamically according to the hierarchical type of each potential peak site. The neighborhood radius determines the spatial range of feature analysis, and its size should be adapted to the scale of the peak. The determination process adopts a hierarchical adaptive strategy, and the neighborhood radius of the main peak candidate point is set to 0.8-1.2 times the half-height width of the peak, the neighborhood radius of the shoulder peak candidate point is 0.6-0.8 times the estimated peak width, and the neighborhood radius of the sub-peak candidate point is 0.4-0.6 times the estimated peak width. This dynamic adjustment ensures that the neighborhood range can completely cover the peak shape characteristics, while avoiding the inclusion of too much irrelevant area, improving the accuracy and pertinence of the analysis.
[0046] In the determined neighborhood, the integral areas of the spectral curve on the left and right intervals are calculated respectively to obtain the left area value and the right area value. The integral area reflects the distribution characteristics of the peak shape on both sides and is the basic data for evaluating the peak asymmetry. The calculation adopts a numerical integration method, usually using the trapezoidal rule or Simpson's rule, and the left interval is defined as [peak site-neighborhood radius, peak site], and the right interval is defined as [peak site, peak site+neighborhood radius]. The integral calculation considers the influence of baseline correction, ensuring that the integral value accurately reflects the peak shape distribution rather than background interference.
[0047] According to the ratio of the difference and the sum of the left area value and the right area value, the asymmetry index is calculated . The asymmetry index quantifies the degree of skewness of the peak shape and is a key indicator for judging the symmetry of the peak shape. The index value range is [-1, 1], and 0 indicates complete symmetry, a positive value indicates right skew (the peak shape trails to the high wavenumber direction), and a negative value indicates left skew (the peak shape trails to the low wavenumber direction). The size of the asymmetry index reflects the degree of skewness, and the larger the absolute value, the stronger the asymmetry.
[0048] The peak shape complexity coefficient is determined by calculating the number of zero points of the high-order derivative of the spectral curve in the neighborhood, combined with the distribution density of the inflection points of the spectral curve. The peak shape complexity coefficient reflects the complexity of the peak shape structure and is an important indicator for distinguishing simple single peaks from complex multi-component peaks. The determination process first calculates the third derivative and fourth derivative sequences, counts the number of sign changes of the third derivative as an estimate of the number of inflection points, calculates the number of zero points of the fourth derivative as a complexity supplement indicator, then calculates the inflection point distribution uniformity coefficient, and finally generates a comprehensive peak shape complexity coefficient through weighted combination. The coefficient usually takes a value range of [0, 5], and the larger the value, the more complex the peak shape, which may contain multiple overlapping components.
[0049] The asymmetry index and the peak shape complexity coefficient are normalized. Normalization eliminates the influence of different dimensions and value ranges, making the indicators comparable and consistent. The Min-Max normalization method is used to map the asymmetry index to the [0, 1] interval (the original value [-1, 1] is transformed The peak shape complexity coefficient is mapped to the interval [0, 1] (scaling is performed by setting an upper limit value). The normalized index retains the relative relationship of the original features, and improves the stability and reliability of subsequent processing, thereby providing standardized parameter input for generating an adaptive distance calculation kernel function.
[0050] In the embodiment of the present application, the detailed implementation steps for generating the adaptive distance calculation kernel function according to the asymmetry index and the peak shape complexity coefficient include:
[0051] The skew direction of the peak shape is identified according to the sign feature of the asymmetry index, and a correlation coefficient of the skew degree and the peak top position offset is calculated. The skew direction reflects the asymmetry characteristics of the peak shape and is the basis for constructing the directional weight gradient field. The skew direction is determined by the sign of the asymmetry index, and a positive value indicates right skew and a negative value indicates left skew. The correlation coefficient calculation formula is:
[0052] ;
[0053] wherein, is the correlation coefficient, is the asymmetry index, is the theoretical peak top position, is the apparent peak top position, is the half-height width of the peak. The correlation coefficient quantifies the relationship strength between the skew degree and the peak top position offset, and usually takes a value in the range [0, 0.5], and the greater the value, the more significant the influence of skew on the peak position.
[0054] Based on the correlation coefficient, a directional weight gradient field is constructed to generate a dense weight distribution on the steep side of the peak shape and a sparse weight distribution on the gentle side. The directional weight gradient field is a spatially varying weight distribution that reflects the contribution of different positions to distance calculation. In the construction process, an asymmetric Gaussian kernel function is used to generate a smaller standard deviation parameter on the opposite side (steep side) of the skew direction, resulting in a dense weight distribution; a larger standard deviation parameter is generated on the same side (gentle side) of the skew direction, resulting in a sparse weight distribution. This design can adapt to the boundary characteristics of the asymmetric peak shape, providing more precise boundary positioning capability on the steep side and tolerating greater boundary ambiguity on the gentle side.
[0055] The peak shape complexity coefficient is converted into an adaptive window scale parameter through a nonlinear mapping function, wherein the higher the complexity, the more precise the window scale. The adaptive window scale parameter determines the spatial resolution capability of the kernel function and directly affects the accuracy of boundary identification. The mapping function adopts an exponential decay form:
[0056] ;
[0057] wherein, is the adaptive window scale parameter, is the baseline window scale (usually set as 1 / 3 of the peak half-height width), is the decay coefficient (usually set as 0.5-1.0), is the peak shape complexity coefficient. This non-linear mapping ensures that the peak region with high complexity obtains a finer window scale, improving the sensitivity to subtle structural changes.
[0058] Within the window scale determined by the adaptive window scale parameter, the distance sensitivity decay function is constructed according to the geodesic distance from the spectral point to the window center, and the decay rate is negatively related to the peak shape complexity coefficient. The distance sensitivity decay function describes the decay law of the influence of spatial distance on weight, which is a key component of the kernel function. The construction adopts the form of generalized Gaussian function:
[0059] ;
[0060] where, is the sensitivity value at the distance , is the adaptive window scale parameter, is the shape parameter, which is negatively related to the peak shape complexity coefficient: is taken as when . This design makes the complex peak shape obtain a slower decay rate, expanding the effective analysis range, while the simple peak shape obtains a faster decay rate, improving the local specificity.
[0061] For different levels of peak sites, based on the peak shape complexity coefficient, the differentiated spatial influence domain is generated through hierarchical feature coding, where the influence domain of the main peak is determined by the convex hull algorithm, the influence domain of the shoulder peak is determined by the local tangent method, and the influence domain of the sub-peak is determined by the minimum circumscribed rectangle. The spatial influence domain defines the effective range of the kernel function, considering the feature differences of different levels of peaks. The main peak influence domain uses the convex hull algorithm to surround the overall outline of the peak; the shoulder peak influence domain uses the local tangent method to identify the boundary area with the main peak, emphasizing accurate description at the boundary; the sub-peak influence domain uses the minimum circumscribed rectangle method to ensure complete coverage of small-scale features. The size of each influence domain is also adjusted by the peak shape complexity coefficient, and the peak with high complexity obtains a relatively expanded influence domain, enhancing the adaptability to complex structures.
[0062] The anisotropic diffusion is applied to the directional weight gradient field in the differentiated spatial influence domain, and the diffusion coefficient is modulated by the distance sensitivity decay function. The anisotropic diffusion is a spatial smoothing technique that can maintain the boundary features while reducing the noise influence. The diffusion process adopts a nonlinear partial differential equation model, which diffuses more strongly in the boundary direction and diffuses more weakly in the boundary normal direction, thereby maintaining the boundary sharpness. The diffusion coefficient is modulated by the distance sensitivity decay function, so as to ensure that the window center region obtains smaller diffusion and retains fine structures, and the edge region obtains larger diffusion and realizes smooth transition. This diffusion strategy significantly improves the boundary positioning ability of the kernel function in complex peak shapes.
[0063] The boundary-constrained optimization is performed on the diffused directional weight gradient field, and the smooth transition of the adaptive distance calculation kernel function at the peak boundary is ensured by solving the Poisson equation. The boundary-constrained optimization is a key step to ensure the stability and reliability of the kernel function in complex peak structures. In the optimization process, the peak boundary is taken as the Dirichlet boundary condition, and the Poisson equation is solved in the influence domain:
[0064] ;
[0065] Wherein, is the kernel function to be optimized, and is an unknown function to be solved in the Poisson equation. In the Raman spectrum analysis, determines how to calculate the "distance" between spectral points, especially how to handle the boundary features of different levels of peaks (main peak, shoulder peak, and sub-peak). is the Laplace operator of the diffused directional weight gradient field, which defines how the kernel function varies in space, thereby guiding the kernel function to form appropriate gradient characteristics in the peak boundary region. is the Laplace operator, which is a second-order differential operator representing the sum of the second-order partial derivatives of the function K in each spatial direction. The solution is obtained by using the multigrid method or the conjugate gradient method, so as to obtain a smooth solution that satisfies the boundary condition, ensure the continuous transition of the kernel function at the boundary, and avoid the segmentation error caused by the artificial boundary effect.
[0066] The adaptive distance calculation kernel function is globally optimized by the variational method, the total variation of the kernel function is minimized while the local feature response ability is maintained, so as to generate the final adaptive distance calculation kernel function. The global optimization is an important step to improve the overall performance of the kernel function, and the smoothness and edge preservation are balanced by the variational method. The optimization objective function is:
[0067] ;
[0068] Wherein, represents the gradient of the kernel function , that is, Variation rate in each direction in space; the first term is the total variation term to promote smoothing, and the second term is the fidelity term to keep local features, is the kernel function before optimization, is the balance parameter, which is usually dynamically adjusted according to the complexity of the peak shape. The optimization is solved by gradient descent or ADMM algorithm, and the final kernel function with smoothness and local response ability is obtained, which provides an accurate and reliable measurement tool for distance calculation.
[0069] In the embodiment of the present application, based on the adaptive distance calculation kernel function, the weighted distance of each spectral point to its left and right effective trough is calculated, and the detailed implementation steps of generating the hierarchical perception distance vector include:
[0070] For each spectral point, all the trough candidate points on its left and right sides are identified by a local minimum value detection algorithm. The trough candidate point is a potential peak boundary position and is the basis for calculating the distance vector. The detection algorithm uses a local minimum value search strategy to find points that satisfy the first derivative of zero and the second derivative of positive on the left and right sides of the spectral point. In order to improve the detection reliability, threshold filtering is applied to ignore the false trough caused by small fluctuations, and the trough depth is usually required to be greater than a certain proportion (such as 15%-25%) of the average intensity of the surrounding area. For the area with large noise, local smoothing is performed before detection to ensure the stability of the identification result.
[0071] According to the depth value of the trough candidate point and the spectral distance from the current spectral point, the effectiveness score of each trough candidate point is calculated. The effectiveness score quantifies the reliability of the trough as a peak boundary and is the basis for selecting the optimal trough. The calculation formula is:
[0072] ;
[0073] wherein, is the effectiveness score, is the trough depth (normalized depth value relative to the local baseline), is the spectral distance from the current spectral point, is the scale parameter (usually set to 1 / 3 of the average peak width of the current region). This formula considers both the depth and distance of the trough, with higher scores for deeper troughs and lower scores for longer distances, which conforms to the physical characteristics of the true peak boundary.
[0074] The left and right side valleys with the highest effectiveness scores are selected as effective valleys, denoted as left effective valley and right effective valley. The effective valleys are the reference points for distance calculation and represent the most likely peak boundary positions. The selection process compares the effectiveness scores of all candidate points on both sides and selects the valleys with the highest scores. For some special cases, such as no candidate points on one side or all candidate points with too low scores, fixed distance extrapolation or estimation of valley position based on statistical characteristics of the adjacent region can be used to ensure that each spectral point can obtain reasonable left and right effective valleys.
[0075] The adaptive distance calculation kernel function is used to calculate the weighted distance from the current spectral point to the left and right effective valleys. The weighted distance is an improved form of the traditional Euclidean distance, considering the influence of peak shape characteristics on distance measurement. The calculation formula is:
[0076] ;
[0077] wherein, is the weighted distance from point to valley , is the Euclidean distance from point to valley , is the integral average value of the adaptive distance calculation kernel function on path . This weighting strategy makes distance calculation adaptive to peak shape characteristics, providing more accurate distance measurement in complex boundary regions and effectively solving the limitations of traditional distance measurement in peak overlapping regions.
[0078] The weighted distance and the hierarchical information of potential peak sites are encoded and fused to generate a distance vector containing hierarchical perception information. The hierarchical perception distance vector not only contains spatial distance information but also fuses peak hierarchical structure information, providing more rich feature representation for segmentation decision. Fusion uses a hierarchical encoding function:
[0079] ;
[0080] wherein, is the hierarchical perception distance vector of point , and are the weighted distances to the left and right effective valleys, is the hierarchical encoding item, reflecting the peak hierarchical type (main peak, shoulder peak or sub-peak) and its confidence degree to which point belongs. The hierarchical encoding item is determined by the association relationship with the nearest potential peak site, enabling the distance vector to effectively distinguish different hierarchical peak structures and provide hierarchical prior information for subsequent segmentation.
[0081] In the embodiment of the present application, the standardized spectrum sequence is extracted by a deep neural network, and an initial probability vector is output, and the detailed implementation steps of combining the hierarchical perception distance vector for probability distribution correction include:
[0082] A deep neural network comprising a plurality of one-dimensional convolution layers and an attention mechanism module is constructed to perform end-to-end feature learning on the standardized spectrum sequence. The deep neural network is a powerful tool for extracting complex spectral features and can automatically learn the implicit patterns in the spectral data. The network structure comprises 3-5 one-dimensional convolution layers, each followed by batch normalization and a ReLU activation function, and the convolution kernel size increases from small to large (3, 5, 7, 9, 11) layer by layer to capture features of different scales. The attention mechanism module adopts a self-attention design, which enhances the expression ability of important features by calculating the correlation between different positions of the spectrum. The network training uses a labeled spectral data set, uses a cross-entropy loss function and an Adam optimizer, and uses a cosine annealing strategy for the learning rate to ensure that the model converges to the optimal solution.
[0083] A skip connection is introduced in the middle layer of the network to preserve spectral feature information at different abstraction levels. The skip connection is an effective technique to solve the gradient vanishing problem of deep networks and preserve multi-level features. The implementation adopts a residual connection structure, which directly adds the output of the previous layer to the output of the next layer through a short circuit connection to form a residual learning mode. The specific design includes: long skip connection from shallow to deep to preserve original detail information; short skip connection between adjacent layers to enhance local feature transmission; parallel fusion of different scale features to integrate multi-scale information. This multi-level feature preservation mechanism significantly improves the network's ability to recognize complex peak shapes, especially the ability to distinguish shoulder peaks and sub-peaks, which are easily confused structures.
[0084] An initial probability value of each spectral point belonging to a feature peak is generated through the output layer of the network to form an initial probability vector. The initial probability vector is the original judgment of the neural network on the spectral peak structure, reflecting the data-driven feature recognition result. The output layer uses a Sigmoid activation function to convert the feature mapping to a probability value in the [0, 1] interval, representing the likelihood of each spectral point belonging to a peak region. To improve the reliability of the probability estimate, an attention gate mechanism is added before the output layer to dynamically adjust the output weight of different positions based on local context information, enhance the probability judgment accuracy of high signal-to-noise ratio regions, and reduce the uncertainty influence of noise regions. The initial probability vector, as a pure data-driven result, provides a basis for subsequent fusion with prior knowledge.
[0085] Based on the hierarchical information in the distance vector perceived by hierarchy, differentiated probability correction coefficients are set for peak regions at different levels. These probability correction coefficients are key parameters that integrate prior knowledge with data-driven results, allowing for targeted adjustments based on the hierarchical characteristics of the peaks. The setting process first extracts the peak hierarchy identifier corresponding to each spectral point from the distance vector, and then assigns different correction coefficients according to the hierarchy type: a baseline coefficient of 1.0 is set for the main peak region to maintain its original probability value; a correction coefficient of 0.7-0.9 is set for the shoulder peak region based on its relative height ratio to the main peak; and a correction coefficient of 0.5-0.7 is set for the sub-peak region based on its degree of independence. At the boundaries between hierarchical regions, a Gaussian kernel function is used to achieve a smooth transition of the correction coefficients, avoiding abrupt changes in the probability distribution. This differentiated setting reflects the differences in the difficulty and importance of identifying peaks at different levels, helping to balance the accuracy of identifying main and secondary peaks.
[0086] The corrected probability vector is obtained by performing pointwise multiplication of the initial probability vector with the probability correction coefficient and then applying local smoothing. The corrected probability vector integrates data-driven results and prior knowledge, providing a more accurate estimate of peak attribute probability. The pointwise multiplication operation directly applies the correction coefficient to the initial probability:
[0087] ;
[0088] in, For point The corrected probability value, The initial probability value, The coefficients represent probability corrections. Local smoothing employs an adaptive window averaging method, with the window size proportional to the local peak width, ensuring the smoothing process does not disrupt the basic morphological characteristics of the peaks. This fusion strategy preserves the data features extracted by the neural network while introducing prior constraints based on physical and chemical knowledge, significantly improving the accuracy and reliability of probability estimation and providing higher-quality input for subsequent segmentation decisions.
[0089] In this embodiment of the invention, the detailed implementation steps for constructing a joint segmentation decision function with a multi-level peak structure based on the corrected probability vector and the hierarchical sensing distance vector include:
[0090] The modified probability vector is analyzed for continuity, identifying local maximum points of probability values and their influence domains. Overlapping regions of adjacent influence domains are marked as regions to be decided. Local maximum points usually correspond to the central positions of peaks and are the starting points for constructing segmentation regions. The identification uses sliding window maximum detection to ensure the local significance of maximum points. Influence domains are determined by expanding from maximum points to both sides until the probability value decreases to a threshold or encounters another rising trend, reflecting the coverage of peaks. The overlapping region of adjacent influence domains is the region where the peak boundary is ambiguous and needs accurate decision-making to achieve accurate segmentation. This analysis method based on probability continuity can effectively identify the multi-peak structure in complex spectra, providing initial division for subsequent boundary optimization.
[0091] In each region to be decided, the directional derivative of the hierarchical perception distance vector is extracted, and the segmentation tendency index of the region is determined by calculating the ratio of the left derivative to the right derivative. The directional derivative reflects the trend of distance change and is an important basis for judging point attribution. The left derivative and the right derivative are calculated as the rate of change of the distance vector in the left and right directions, respectively.
[0092] The segmentation tendency index is calculated as:
[0093] ;
[0094] The index greater than 1 indicates that the point is more inclined to belong to the right peak, less than 1 indicates that it is more inclined to belong to the left peak, and close to 1 indicates that it is in the boundary position. This analysis based on distance gradient provides segmentation basis from the perspective of spatial structure, supplementing the judgment information of probability distribution.
[0095] Based on the segmentation tendency index, a region attribution probability transition matrix is constructed, and the matrix elements represent the transition probability of each point in the region to be decided to belong to adjacent peaks. The transition matrix is a mathematical representation of the attribution possibility of points between different peaks, providing a probability framework for segmentation decision-making. The matrix construction uses the Sigmoid transformation of the segmentation tendency index:
[0096] ;
[0097] wherein, is the probability of point from peak to peak , is the steepness parameter, is the offset parameter (usually set to 1). The transition matrix satisfies the constraint that the row sum is 1, ensuring the rationality of probability interpretation. This probability transition model can handle ambiguous boundaries, allowing soft segmentation results, and is more consistent with the physical reality of spectral peak overlap.
[0098] The local curvature information of the probability vector and the second-order difference information of the distance vector are tensor product operated to generate a probability-distance coupling feature tensor. The coupling feature tensor fuses the two complementary information of probability distribution and spatial structure, providing a more comprehensive segmentation feature representation. The calculation process first extracts the local curvature (second derivative) of the probability vector and the second-order difference of the distance vector, and then correlates the two through tensor product operation:
[0099] ;
[0100] wherein f is the coupling feature tensor of point x, p is the probability curvature vector, d is the distance second-order difference vector, and represents the tensor product operation. The coupling feature tensor contains the correlation information of probability change and distance change, which can more effectively describe the peak boundary features, especially in complex overlapping regions. The principal component direction is extracted as the candidate segmentation line of the peak boundary by singular value decomposition of the probability-distance coupling feature tensor. Singular value decomposition is a mathematical tool for extracting the main change direction of data, which is used to determine the best segmentation direction. The decomposition process processes the coupling feature tensor of each region to be decided:
[0101] ;
[0102] wherein U and V contain left and right singular vectors, and is the singular value diagonal matrix, and is the transpose. The singular vector corresponding to the maximum singular value indicates the direction of the most significant data change, which usually corresponds to the best segmentation direction of the peak boundary. On this basis, combined with the geometric characteristics of the region to be decided, a set of candidate segmentation lines are generated, each line representing a possible boundary position. This segmentation line generation method based on data change direction can adapt to complex peak shapes and provide boundary candidates with clear physical meaning.
[0103] The energy functional is calculated along each candidate segmentation line, and the energy functional is composed of probability gradient term, distance continuity term and hierarchy consistency term. The segmentation line that minimizes the energy functional is solved by the variational principle as the optimal boundary. The energy functional is a mathematical measure to evaluate the quality of segmentation, which considers multiple segmentation criteria. The energy formula is:
[0104] ;
[0105] wherein s is the candidate segmentation line, p is the probability gradient vector, d is the distance continuity vector, and is the hierarchy consistency vector.
[0106] E (C) represents the total value of the energy functional calculated along the candidate segmentation line C; For the probability gradient term, the boundary is located at the place where the probability changes most, For the distance continuity term, the boundary is consistent with the distance field structure, For the hierarchy consistency term, the boundary is coordinated with the peak hierarchy structure, 、 、 For the weight coefficient, the curve that makes the energy minimum is solved by the variational method as the optimal segmentation boundary, and the accurate segmentation of the multi-criteria collaborative optimization is realized.
[0107] Based on the determined optimal boundary and the region attribution probability transition matrix, a joint segmentation decision function of the multi-level peak structure is constructed, and the function outputs the peak attribution label and confidence of each spectral point. The joint segmentation decision function is a mathematical model for finally performing the segmentation task, and comprehensively considers all the foregoing analysis results. The function form is as follows:
[0108] ;
[0109] Wherein, is the peak attribution label of the point , and is the corresponding confidence. The decision process directly adopts the influence domain label of the local maximum point for the non-decision region; for the decision region, the optimal boundary position and the transition matrix probability are combined for judgment, and the decision confidence is calculated. The joint decision mechanism considers the accuracy of the hard boundary and retains the uncertainty information of the soft probability, so that more comprehensive segmentation results are provided for subsequent analysis.
[0110] Through the hierarchy propagation mechanism of the joint segmentation decision function, the recursive identification and accurate segmentation of the main peak, the shoulder peak and the sub-peak are realized. As shown in Figure 3 , it is a schematic diagram of the final segmentation effect of the method; the hierarchy propagation mechanism is a key technology for processing the multi-level peak structure, and the hierarchical segmentation is realized through the recursive processing from top to bottom. The mechanism first identifies and segments the main peak, then finds the shoulder peak feature in the main peak region, and further identifies the sub-peak structure in the shoulder peak or main peak region. The segmentation of each level uses the result of the last level as a constraint condition, so as to ensure the consistency of the hierarchy structure. The recursive segmentation strategy is consistent with the physical mechanism of the spectral peak formation, can effectively process the complex multi-level peak structure, and provides accurate and hierarchical segmentation results.
[0111] In the embodiment of the application, through the cross-scale peak site correlation analysis, the detailed implementation steps of the subordination relationship atlas between the peak sites of different levels include:
[0112] Between adjacent scale layers, the spatial similarity and intensity correlation of candidate peak sites are calculated. Spatial similarity and intensity correlation are key indicators for determining whether peak sites at different scale layers correspond to the same physical feature. Spatial similarity is calculated using normalized Euclidean distance:
[0113] ;
[0114] in For scale peak points in With scale peak points in Spatial similarity between them For scale Mid-peak location With scale Mid-peak location Wavenumber position difference, The scale parameter is typically set to 1 / 5 of the average peak width. Intensity correlation is calculated using the correlation coefficient of intensity distribution within the peak location's neighborhood, reflecting the similarity of peak shapes. These two indicators comprehensively evaluate the correspondence of peak locations in multi-scale space, providing a quantitative basis for establishing cross-scale connections.
[0115] For peak point pairs that meet the similarity threshold, cross-scale connections are established to form a multi-scale association network of peak points. The multi-scale association network is a graph structure that describes the connectivity relationships between peak points at different scales. The connection establishment process sets a comprehensive similarity threshold, typically requiring spatial similarity greater than 0.7 and correlation strength greater than 0.5. Peak point pairs meeting these conditions establish directed connections from lower to higher scales. The network construction adopts a bottom-up strategy, first connecting adjacent scale layers, and then establishing indirect connections across multiple layers through transitive relationships. This multi-scale association network comprehensively describes the evolution of peak features in scale space, providing a topological foundation for subsequent hierarchical analysis.
[0116] The connectivity of multi-scale interconnected networks is analyzed using graph theory algorithms to identify dominant peak nodes that stably exist across multiple scales. Dominant peak nodes are a significant feature of stability across multiple scales, representing the main component peaks in the spectrum. The identification process employs connected component analysis and node centrality measures to calculate the cross-scale persistence index for each node.
[0117] ;
[0118] in, For nodes The cross-scale persistence index, For nodes In scale An indicator function for existence (1 if it exists, 0 otherwise). For the scale The weight of the scale (usually the high scale weight is large). The peak site with a persistence index greater than a preset threshold (usually 70% of the total scale number) and high node centrality is identified as a main peak node. This main peak identification method based on multi-scale stability can effectively distinguish the main features from noise or secondary features, providing a reliable basis for peak hierarchy division.
[0119] For the peak site appearing only in part of the scale, it is determined to be a shoulder peak or a sub-peak according to the shortest path length thereof from the main peak node. The shortest path length reflects the close degree of the peak site and the main peak node, and is an important basis for judging the type of secondary peak hierarchy. The calculation uses Dijkstra algorithm to find the shortest path in the multi-scale correlation network, and the path length considers the connection strength as the weight. The determination rule is: the peak site directly connected with the main peak node (path length is 1) and appearing in the medium scale layer is determined to be a shoulder peak; the peak site connected with the main peak or shoulder peak node through multi-step connection (path length is greater than 1) or appearing only in the lowest scale layer is determined to be a sub-peak. This hierarchy determination method based on topological relationship considers the scale characteristics and spatial correlation of the peak, and can accurately distinguish different types of secondary peak structures.
[0120] Based on the spatial proximity and intensity inclusion relationship between the peak sites, a hierarchical subordination graph is constructed. The subordination graph is a tree structure, which describes the hierarchical dependence relationship between the main peak, shoulder peak and sub-peak. The construction process first sets the main peak node as the root node, and then establishes the subordination connection according to the spatial proximity (the wave number position difference is less than a preset threshold) and the intensity inclusion relationship (the low-level peak is located within the influence range of the high-level peak). Each edge in the graph represents a pair of subordination relationship, for example, the shoulder peak belongs to a certain main peak, and the sub-peak belongs to a certain shoulder peak or main peak. The finally formed subordination graph comprehensively describes the hierarchical organization of the peak structure in the spectrum, providing structured prior knowledge for subsequent segmentation, which is especially helpful for solving the boundary division problem of the peak overlap region.
[0121] In the embodiment of the application, the detailed implementation steps for determining the peak shape complexity coefficient include:
[0122] The third derivative and the fourth derivative sequence of the spectrum curve in the neighborhood are calculated. The high-order derivative contains the fine structure information of the curve shape, which is an important tool for evaluating the peak complexity. The calculation uses the finite difference method, considers the noise influence, and first performs appropriate smoothing processing (usually using Savitzky-Golay filtering) on the spectrum curve, and then calculates the third derivative. In order to improve the calculation stability, the high-order derivative sequence is again slightly smoothed to eliminate the artificial fluctuations caused by numerical calculation and retain the true physical characteristics.
[0123] The number of sign changes in the third derivative sequence is counted as an estimate of the number of inflection points. The zeros of the third derivative correspond to the positions of the inflection points of the original curve, which are the key feature points of the curve shape change. The statistical process first identifies the sign change points in the third derivative sequence (from positive to negative or from negative to positive), and then applies a threshold to filter out the false change points caused by small fluctuations, usually requiring the absolute values before and after the change to be greater than a certain multiple (such as 1.5 times) of the standard deviation of the sequence. The number of inflection points is a direct indicator of peak complexity, and a simple and single Gaussian peak usually has only 2 inflection points (one on each side of the peak), while a complex multi-component overlapping peak may have 4 or more inflection points, reflecting the complexity of the peak structure.
[0124] The number of zeros of the fourth derivative sequence is calculated as a supplementary indicator of curve complexity. The zeros of the fourth derivative correspond to the extreme points of the curvature of the original curve, providing additional information about the peak shape structure. The calculation process is similar to that of the third derivative, identifying the zeros and performing filtering to ensure the reliability of the results. The number of zeros of the fourth derivative reflects the complexity of the peak profile, especially for the shape characteristics of asymmetric peaks and overlapping peaks, and is a effective supplement to the inflection point analysis of the third derivative. By combining the information of the third and fourth derivatives, the complexity of the peak shape can be more comprehensively evaluated.
[0125] According to the ratio of the minimum distance to the average distance between the inflection points, the uniformity coefficient of the inflection point distribution is determined. The uniformity coefficient reflects the spatial characteristics of the inflection point distribution and is an important indicator for distinguishing different types of complex peaks. The calculation formula is:
[0126] ;
[0127] where, is the distance between adjacent inflection points, is the minimum distance, is the average distance. The uniformity coefficient has a value range of [0, 1], and the closer the value is to 1, the more uniform the inflection point distribution, which usually corresponds to a single wide peak; the smaller the value, the more uneven the distribution, which usually corresponds to a multi-peak overlapping structure. This indicator can effectively distinguish between wide single peaks and multi-peak overlapping structures, providing morphological information that traditional kurtosis and skewness indicators cannot capture.
[0128] The number of inflection points, the number of zeros, and the uniformity coefficient are combined to generate a comprehensive peak shape complexity coefficient. The peak shape complexity coefficient is a dimensionless indicator that comprehensively evaluates the complexity of the peak shape structure, integrating multiple morphological characteristics. The combination formula is:
[0129] ;
[0130] where, is the peak shape complexity coefficient, is the number of inflection points, is the number of fourth derivative zeros, is the homogeneity coefficient, , , is the weight coefficient (usually set to 0.5, 0.3, 0.2). The formula design considers the reference state of normal single peak (2 inflection points, 2 fourth derivative zeros, homogeneity close to 1), normalizes the complexity coefficient to the interval [0, 1], and the larger the value, the more complex the peak shape. This comprehensive evaluation method can accurately reflect the structural characteristics of various complex peak shapes and provide reliable complexity quantification indicators for subsequent processing.
[0131] In the embodiments of the present application, the detailed implementation steps for setting different peak region probability correction coefficients for different levels according to the level information in the level-aware distance vector include:
[0132] The peak level identifier corresponding to each spectral point is extracted from the level-aware distance vector. The peak level identifier is the level information encoded in the distance vector, which directly reflects the peak level type to which the spectral point belongs. The extraction process is usually located in a specific dimension of the vector or obtained by a specific decoding function according to the structure design of the distance vector. The level identifier usually uses discrete values to represent different types: for example, value 1 represents the main peak region, value 2 represents the shoulder peak region, and value 3 represents the sub-peak region, or uses continuous values to represent the probability distribution of level attribution. The extracted level identifier provides a partition basis for subsequent differential processing, ensuring that different types of peak regions obtain appropriate processing strategies.
[0133] Based on the peak level identifier, the reference correction coefficient for the main peak region is set to 1.0, keeping its original probability value. The main peak is the most prominent and reliable feature in the spectrum, and the neural network usually has high accuracy in identifying it, so keeping the original probability value is a reasonable strategy. The setting process sets the correction coefficient of all spectral points with peak level identifier as the main peak to 1.0, ensuring that the probability judgment of the main peak region is not affected by human adjustment. This processing reflects the trust in the neural network's ability to identify the main peak, and also serves as a reference for other level corrections, ensuring the consistency and interpretability of the correction process.
[0134] For the shoulder peak region, a correction coefficient between 0.7 and 0.9 is set according to its relative height ratio to the main peak. The shoulder peak is a secondary peak structure attached to the side of the main peak, and its identification difficulty is greater than that of the main peak but less than that of the sub-peak, requiring moderate probability enhancement. The correction coefficient calculation formula is:
[0135] ;
[0136] wherein, is the correction coefficient of point is the correction coefficient of point is the shoulder peak in point the height of the shoulder peak, The relative height ratio is larger, the more significant the shoulder peak is, and the correction coefficient is closer to 1; the relative height ratio is smaller, the less significant the shoulder peak is, and the correction coefficient is closer to 0.7. This dynamic adjustment based on physical characteristics ensures that the correction coefficient matches the actual significance of the shoulder peak, improving the pertinence and effectiveness of probability correction.
[0137] For the sub-peak region, a correction coefficient between 0.5 and 0.7 is set according to its degree of independence. Sub-peak is a small-scale feature in the spectrum, usually with low signal-to-noise ratio or serious overlap with other peaks, which is the most likely to be missed by the neural network and needs strong probability enhancement. The correction coefficient calculation formula is:
[0138] ;
[0139] where, is the independence index of the sub-peak where point p is located, calculated by the separation degree of the sub-peak from the surrounding peaks. The index of a completely separated independent sub-peak is close to 1, and the index of a seriously overlapped sub-peak is close to 0. This design makes sub-peaks with strong independence obtain a higher correction coefficient (close to 0.7), enhancing their probability of being correctly identified; while seriously overlapped sub-peaks obtain a lower correction coefficient (close to 0.5), reflecting their inherent uncertainty of identification. This differential strategy balances the relationship between enhancing identification rate and maintaining physical rationality.
[0140] At the junction of different hierarchical regions, the correction coefficient is smoothly transitioned through a Gaussian kernel function to avoid the mutation of the probability distribution. The smooth transition at the junction of the regions is an important step to ensure the continuity of the probability distribution, which helps to generate physically reasonable segmentation results. The implementation adopts a spatially weighted average:
[0141] ;
[0142] where, is the final correction coefficient of point p, is the original correction coefficient of each hierarchical region, is the spatial weight, calculated by a Gaussian kernel function:
[0143] ; where,
[0144] is the distance from point p to the boundary of region r, The smoothing parameter (usually set to 1 / 3 of the width of the junction region) is used to smooth the modified coefficients. This smoothing process ensures the gradual transition of the modified coefficients at the junction of the regions, avoids the discontinuity of the probability distribution caused by the hard threshold switching, and generates a smooth probability field that is more consistent with the physical reality, providing a continuous and reliable probability basis for subsequent segmentation decisions.
[0145] The present application realizes the accurate segmentation and hierarchical labeling of the main peak, shoulder peak and sub-peak in the Raman spectrum by obtaining the original intensity sequence data of the Raman spectrum and performing multi-scale wavelet decomposition, combining the local curvature change rate calculation to identify potential peak sites, constructing an accurate neighborhood topological structure and an adaptive distance calculation kernel function, and generating hierarchical perception distance vectors and probability vectors.
[0146] The above are only preferred embodiments of the present application and are not used to limit the present application, although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing embodiments or make equivalent replacements for some technical features. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
[0147] It should be noted that the formulas in the present specification are dimensionless numerical calculations, the formula is obtained by software simulation of a large number of data to obtain the most real situation, and the preset parameters and threshold values in the formula are set by those skilled in the art according to the actual situation.
[0148] Although the embodiments of the present application have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, replacements and variations can be made to these embodiments without departing from the principles and purposes of the present application, and the scope of the present application is defined by the claims and their equivalents.
Claims
1. A method for segmenting Raman spectral characteristic peaks based on distance vector and probability vector outputs, characterized in that, include: The raw intensity sequence data of the Raman spectrum to be analyzed is obtained, and the raw intensity sequence data is preprocessed to obtain a standardized spectral sequence; The standardized spectral sequence is subjected to multi-scale wavelet decomposition to extract spectral detail features under different frequency components and construct a multi-level spectral structure representation matrix. Based on the aforementioned spectral multi-level structure characterization matrix, potential peak sites and their hierarchical affiliations are identified by calculating the local curvature change rate within a sliding window. For each potential peak point, a neighborhood topology centered on that point is constructed, and the asymmetry index and peak shape complexity coefficient within that neighborhood are calculated. An adaptive distance calculation kernel function is generated based on the asymmetry index and the peak shape complexity coefficient. Based on the adaptive distance calculation kernel function, the weighted distance from each spectral point to its left and right effective valleys is calculated to generate a hierarchical sensing distance vector. Feature extraction is performed on the standardized spectral sequence using a deep neural network to output an initial probability vector, which is then combined with the distance vector of the hierarchical perception to correct the probability distribution. Based on the corrected probability vector and the distance vector of the hierarchical perception, a joint segmentation decision function with a multi-level peak structure is constructed. Based on the joint segmentation decision function, accurate segmentation and hierarchical labeling of the main peak, shoulder peak, and sub-peaks in the Raman spectrum are achieved.
2. The Raman spectral characteristic peak segmentation method based on distance vector and probability vector output according to claim 1, characterized in that, The process of identifying potential peak sites and their hierarchical affiliations based on the spectral multi-level structure characterization matrix, through calculation of the local curvature change rate within a sliding window, includes: An adaptively sized sliding window is set at each scale level of the spectral multi-level structure characterization matrix; Calculate the second derivative sequence of the spectral curve within each sliding window, and extract the sign change points of the second derivative sequence as candidate peak locations; For each candidate peak location, its significance score at different scale levels is calculated, and the significance score is determined by the ratio of the absolute value of curvature at that point to the average curvature of the neighborhood. Based on the distribution pattern of the significance score at each scale level, the hierarchical type of the candidate peak site is determined; Based on the determined hierarchical type, a hierarchy map of peak sites at different levels is established through cross-scale peak site correlation analysis to determine the hierarchical affiliation of the potential peak sites.
3. The Raman spectral characteristic peak segmentation method based on distance vector and probability vector output according to claim 1, characterized in that, For each potential peak point, a neighborhood topology is constructed centered on that point, and the asymmetry index and peak complexity coefficient within that neighborhood are calculated, including: The neighborhood radius is dynamically determined based on the hierarchical type of each potential peak point. Within a defined neighborhood, calculate the area integral of the spectral curves for the left and right intervals respectively to obtain the area values for the left and right sides. The asymmetry index is calculated based on the ratio of the difference between the area values on the left and the right to the sum of their values. The peak shape complexity coefficient is determined by calculating the number of zeros of the higher-order derivatives of the spectral curve in the neighborhood and combining this with the inflection point distribution density of the spectral curve. The asymmetry index and the peak complexity coefficient are normalized.
4. The Raman spectral characteristic peak segmentation method based on distance vector and probability vector output according to claim 1, characterized in that, The step of generating an adaptive distance calculation kernel function based on the asymmetric exponent and the peak complexity coefficient includes: The skew direction of the peak shape is identified based on the sign characteristics of the asymmetry index, and the correlation coefficient between the degree of skew and the offset of the peak position is calculated. Based on the correlation coefficient, a directional weight gradient field is constructed, generating a dense weight distribution on the steep side of the peak and a sparse weight distribution on the flat side. The peak-shaped complexity coefficient is converted into an adaptive window scale parameter through a nonlinear mapping function; Within the window scale determined by the adaptive window scale parameter, a distance sensitivity attenuation function is constructed based on the geodesic distance from the spectral point to the center of the window; For peak locations of different levels, a differentiated spatial influence domain is generated through hierarchical feature encoding based on the peak shape complexity coefficient. The directional weight gradient field is anisotropically diffused within the differentiated spatial influence domain; Boundary constraint optimization is performed on the diffused directional weight gradient field, and the smooth transition of the adaptive distance calculation kernel function at the peak boundary is ensured by solving the Poisson equation. The adaptive distance calculation kernel function is globally optimized using a variational method to minimize the total variation of the kernel function while preserving its local feature response capability, thereby generating the final adaptive distance calculation kernel function.
5. The Raman spectral characteristic peak segmentation method based on distance vector and probability vector output according to claim 1, characterized in that, The step of calculating the weighted distance from each spectral point to its left and right effective valleys based on the adaptive distance calculation kernel function, and generating a hierarchical sensing distance vector, includes: For each spectral point, all candidate valley points on its left and right sides are identified using a local minimum detection algorithm; Calculate the effectiveness score of each trough candidate point based on its depth value and spectral distance from the current spectral point; Select the left and right troughs with the highest validity scores as valid troughs, and denote them as left valid troughs and right valid troughs; Using the adaptive distance calculation kernel function, the weighted distances from the current spectral point to the left effective valley and the right effective valley are calculated respectively. The weighted distance is encoded and fused with the hierarchical information of the potential peak points to generate a distance vector containing hierarchical perception information.
6. The Raman spectral characteristic peak segmentation method based on distance vector and probability vector output according to claim 1, characterized in that, The step of extracting features from the standardized spectral sequence using a deep neural network, outputting an initial probability vector, and then correcting the probability distribution by combining it with the distance vector from the hierarchical perception includes: A deep neural network containing multiple one-dimensional convolutional layers and an attention mechanism module is constructed to perform end-to-end feature learning on the standardized spectral sequence; Skip connections are introduced in the middle layer of the network to preserve spectral feature information at different levels of abstraction; The output layer of the network generates an initial probability value for each spectral point belonging to a feature peak, forming an initial probability vector; Based on the hierarchical information in the distance vector perceived by the hierarchy, differentiated probability correction coefficients are set for peak regions of different levels. The corrected probability vector is obtained by performing point-by-point product operation between the initial probability vector and the probability correction coefficient, followed by local smoothing.
7. The Raman spectral characteristic peak segmentation method based on distance vector and probability vector output according to claim 1, characterized in that, The step of constructing a joint segmentation decision function with a multi-level peak structure based on the corrected probability vector and the distance vector perceived at each level includes: A continuity analysis is performed on the corrected probability vector to identify the local maxima of the probability values and their influence domains, and the overlapping areas of adjacent influence domains are marked as the decision-making areas. Within each region to be decided, the directional derivative of the distance vector perceived by the hierarchy is extracted, and the segmentation tendency index of the region is determined by calculating the ratio of the left derivative to the right derivative. Based on the aforementioned segmentation tendency index, a region affiliation probability transition matrix is constructed; The local curvature information of the probability vector is multiplied by the second-order difference information of the distance vector to generate a probability-distance coupled feature tensor. By performing singular value decomposition on the probability-distance coupled feature tensor, the principal component directions are extracted as candidate segmentation lines for peak boundaries; The energy functional is calculated along each candidate dividing line. The energy functional consists of a probability gradient term, a distance continuity term, and a hierarchy consistency term. The dividing line that minimizes the energy functional is obtained by using the variational principle and is taken as the optimal boundary. Based on the determined optimal boundary and the region assignment probability transition matrix, a joint segmentation decision function for multi-level peak structures is constructed. This function outputs the peak assignment label and its confidence level for each spectral point.
8. The Raman spectral characteristic peak segmentation method based on distance vector and probability vector output according to claim 2, characterized in that, The method involves establishing a hierarchy map of peak sites at different levels through cross-scale peak site correlation analysis, including: Between adjacent scale layers, the spatial similarity and intensity correlation of candidate peak sites are calculated; Cross-scale connections are established for peak point pairs that meet the similarity threshold, forming a multi-scale association network of peak points; The connectivity of the multi-scale interconnected network is analyzed using graph theory algorithms to identify the main peak nodes that are stable across multiple scales. For peak locations that appear only at certain scales, they are determined to be either shoulder peaks or sub-peaks based on the shortest path length between them and the main peak node. Based on the spatial proximity and intensity inclusion relationship between peak sites, a hierarchical subordinate relationship map is constructed.
9. The Raman spectral characteristic peak segmentation method based on distance vector and probability vector output according to claim 3, characterized in that, The process of determining the peak shape complexity coefficient by calculating the number of zeros of the higher-order derivatives of the spectral curve within the neighborhood and combining this with the inflection point distribution density of the curve includes: Calculate the third and fourth derivative sequences for the spectral curves in the neighborhood; The number of sign changes in the third derivative sequence is counted to estimate the number of inflection points; Calculate the number of zeros in the fourth derivative sequence; The uniformity coefficient of the inflection point distribution is determined based on the ratio of the minimum spacing to the average spacing between inflection points. The number of inflection points, the number of zero points, and the uniformity coefficient are weighted and combined to generate a comprehensive peak shape complexity coefficient.
10. The Raman spectral characteristic peak segmentation method based on distance vector and probability vector output according to claim 6, characterized in that, The step of setting differentiated probability correction coefficients for peak regions at different levels based on the hierarchical information in the hierarchically perceived distance vector includes: Extract the peak level identifier corresponding to each spectral point from the distance vector perceived by the hierarchy; Based on the peak level identifier, a baseline correction coefficient of 1.0 is set for the main peak region to maintain its original probability value; For the shoulder peak region, a correction factor between 0.7 and 0.9 is set based on its relative height ratio to the main peak; For sub-peak regions, a correction factor between 0.5 and 0.7 is set according to their degree of independence; At the boundaries of different hierarchical regions, a smooth transition of the correction coefficients is achieved through a Gaussian kernel function.
Citation Information
Patent Citations
Robust Raman spectrum peak identification method
CN109283169A
Peak-preserving and enhancing baseline correction methods for raman spectroscopy
US20210270742A1