Method and system for correcting spectral information in spectral abnormality areas
Through multi-scale gradient analysis and flow field topology processing of fiber confocal micro Raman spectroscopy system, combined with thermonuclear function and gradient-guided repair, the problem of loss of feature details in spectral anomaly correction is solved, and high-precision correction of composite anomaly and the integrity of spectral structure is achieved.
Patent Information
- Application Number
- CN202510696080.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-05-28
AI Technical Summary
The existing spectral anomaly correction methods are difficult to adapt when facing composite anomalies or unknown background interference, resulting in the loss of spectral feature details and affecting the accuracy of the analysis.
Data was collected through the fiber confocal micro Raman spectroscopy system for multi-scale gradient analysis, combined with flow field topology analysis and thermonuclear function processing, and multi-scale characteristic spectral collection was constructed, gradient-guided reconstruction and hierarchical guided repair were used to achieve correction of spectral abnormal regions.
It improves the adaptability to unknown backgrounds and complex peak shapes, maintains the integrity and continuity of spectral structure, effectively retains detailed characteristics, and avoids the problem of excessive smoothing of traditional methods.
Smart Images

Figure CN120217270B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spectrum correction, and in particular to a method and system for correcting spectrum information in a spectrum abnormality region. Background Art
[0002] Fiber-optic confocal Raman microscopy is a rapid, non-destructive, and "fingerprint-specific" spectral analysis technique widely used in fields such as materials science, biomedicine, and chemical analysis. It can directly reveal information such as a material's chemical structure, phase and morphology, and intermolecular interactions. However, in practical applications, Raman spectral data often exhibit spectral anomalies such as baseline drift, peak position shifts, and intensity anomalies due to factors such as sample heterogeneity, environmental interference, instrument noise, and optical path instability. These anomalies seriously affect subsequent qualitative and quantitative analysis, leading to inaccurate results and even erroneous conclusions.
[0003] Existing spectral anomaly correction methods are primarily based on statistical principles and pattern recognition techniques, such as principal component analysis, wavelet transforms, and Fourier filtering. However, these methods often rely on pre-set peak shape assumptions or statistical models, making them limited in their effectiveness for spectral correction in complex anomaly situations. Traditional methods are particularly difficult to adapt to complex anomalies (multiple anomaly types present simultaneously) or unknown background interference, and are prone to loss of spectral feature details during processing, particularly inadequate preservation of subtle structures and characteristic peaks, impacting analytical accuracy. Summary of the Invention
[0004] The present invention provides a method and system for correcting spectral information of spectral abnormal regions, which can accurately describe the topological relationship between abnormal regions and normal regions, and better maintain the structural integrity and continuity of the spectrum during the correction process.
[0005] In a first aspect, the present invention provides a method for correcting spectral information of a spectral abnormal region, the method comprising:
[0006] The fiber optic confocal micro-Raman spectroscopy system was used to collect raw spectral data and perform multi-scale gradient analysis to obtain multi-layer gradient flow field characterization data;
[0007] Performing flow field topology analysis on the multi-layer gradient flow field characterization data to obtain a spectral abnormality region and a boundary point set;
[0008] Based on the spectral abnormal area and the boundary point set, a heat kernel function is performed on the spectral normal area to obtain a multi-scale characteristic spectrum set and a normal reference area;
[0009] Performing gradient-guided reconstruction based on the multi-scale characteristic spectrum set and the normal reference region to obtain preliminary correction data of the spectral abnormality region;
[0010] Performing layered guided repair on the preliminary correction data of the spectral abnormality region to obtain corrected spectral information.
[0011] In a second aspect, the present invention provides a spectral information correction system for spectral anomaly regions, the spectral information correction system for spectral anomaly regions comprising:
[0012] An acquisition module is used to collect raw spectral data through a fiber confocal micro-Raman spectroscopy system and perform multi-scale gradient analysis to obtain multi-layer gradient flow field characterization data;
[0013] An analysis module, configured to perform flow field topology analysis on the multi-layer gradient flow field characterization data to obtain a spectral abnormality region and a set of boundary points;
[0014] A processing module is used to perform heat kernel function processing on the normal spectral region based on the abnormal spectral region and the boundary point set to obtain a multi-scale characteristic spectrum set and a normal reference region;
[0015] a reconstruction module, configured to perform gradient-guided reconstruction based on the multi-scale characteristic spectrum set and the normal reference region to obtain preliminary correction data of the spectral abnormality region;
[0016] The repair module is used to perform layered guided repair on the preliminary correction data of the spectral abnormal area to obtain corrected spectral information.
[0017] The technical solution provided by this invention constructs a multi-layer gradient flow field model, enabling anomaly detection to be independent of pre-defined peak shapes or statistical models. This allows for a more comprehensive capture of the dynamic characteristics of the spectrum and improves adaptability to unknown backgrounds and complex peak shapes. The anomaly detection method based on flow field topology analysis can automatically determine the optimal detection scale, achieving higher accuracy for different types of anomaly regions (such as spectral drift, peak position shift, and intensity anomalies), particularly for complex anomalies that are difficult to identify with traditional methods. Treating the spectral space as a Riemannian manifold and parameterizing it accurately describes the topological relationship between anomaly and normal regions, better preserving the structural integrity and continuity of the spectrum during the correction process. Multi-scale feature extraction in the manifold space using a heat kernel function simultaneously captures both the global structure and local detail features of the spectrum. A hierarchical guided repair strategy is employed, sequentially performing fine correction from baseline configuration to broad peak structure and then to detail feature peaks. This effectively avoids the oversmoothing problem common in traditional global optimization methods and better preserves the spectral detail features. Spectral repair is achieved through a manifold hole-filling algorithm and the solution of the Poisson equation, ensuring a smooth transition between the corrected spectrum and the original normal region at the boundaries of the anomaly region, eliminating repair artifacts and discontinuities. Physical constraints such as non-negativity constraints and peak position retention constraints are introduced during the correction process to ensure that the correction results conform to the physical mechanism of Raman spectroscopy and avoid the generation of spectral characteristics that are inconsistent with reality. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 Schematic diagram of the steps of a method for correcting spectral information of a spectral abnormality region according to an embodiment of the present invention;
[0020] Figure 2 Schematic diagram of the structure of the spectral information correction system for spectral abnormality areas in an embodiment of the present invention. DETAILED DESCRIPTION
[0021] An embodiment of the present invention provides a method and system for correcting spectral information of a spectral anomaly region. The terms "first," "second," "third," "fourth," and so on (if any) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.
[0022] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 An embodiment of a method for correcting spectral information of a spectral abnormality region in an embodiment of the present invention includes:
[0023] Step S1, collecting raw spectral data through a fiber confocal micro-Raman spectroscopy system and performing multi-scale gradient analysis to obtain multi-layer gradient flow field characterization data;
[0024] It is understandable that the execution subject of the present invention may be a spectral information correction system for spectral abnormality regions, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0025] Specifically, a fiber-optic confocal Raman microscope system was used to perform high-precision laser scanning excitation on the sample. A focused laser beam was irradiated onto the sample surface to stimulate Raman scattering signals, which were then guided to the detection module via a fiber optic channel. Raw spectral data covering the entire target wavenumber range was recorded. This raw data consisted of a series of wavenumbers and corresponding light intensity values. Discrete gradient calculation was performed on the raw spectral data. By analyzing the intensity variations between adjacent wavenumber points, the local variation trend at each wavenumber point was estimated, and initial velocity field data describing the fluctuations in the spectral structure was constructed. The formation of the initial velocity field essentially translates the variations in the wavenumber dimension of the spectrum into the concept of "flow." A multi-scale processing strategy was introduced to the initial velocity field data to extract richer feature information. Multiple Gaussian kernel functions with different standard deviations were introduced and smoothed convolution operations were performed on the initial velocity field. The Gaussian kernel functions of different scales emphasized local details or global trends, respectively, generating velocity field data at multiple scale levels. These multi-scale velocity field data revealed the changing behavior of the spectral curve at different observation granularities. The velocity field at each scale is characterized by divergence. This divergence describes whether the spectrum converges or diverges in a local region in wavenumber space, and its magnitude serves as the basis for distinguishing normal from abnormal spectral states. The velocity variation characteristics calculated at each scale are sequentially organized and arranged to construct data representing a multi-layer gradient flow field. These data, in the form of matrices or tensors, describe the flow relationships between points at different scales and wavenumbers, characterizing the dynamic changes in the spectral structure at different levels.
[0026] Step S2: performing flow field topology analysis on the multi-layer gradient flow field characterization data to obtain a spectral abnormal area and a set of boundary points;
[0027] Specifically, based on multi-layer gradient flow field characterization data, the velocity field corresponding to each scale is systematically processed, and the velocity field divergence data at each scale is calculated in sequence. This divergence reflects the local variation trend of the spectrum at different wavenumber points, that is, whether the spectral information in that area tends to be concentrated or divergent. In normal spectral segments, the divergence value varies smoothly, showing a laminar regular structure. However, in abnormal segments with structural distortion, intensity discontinuities, or background disturbances, the divergence value exhibits discontinuous states such as sudden changes and vortices, becoming a key physical quantity for identifying anomalies. Anomaly scores are calculated based on the divergence data. An initial anomaly score is calculated for each wavenumber point based on the ratio between the divergence amplitude and the intensity of the local velocity variation, providing a standardized metric for anomaly identification. Because the scoring results at different scales vary in sensitivity and interference resistance, the initial scores at all scales are weighted and fused. By setting adaptive weight coefficients, the contribution of each scale to the final score is dynamically adjusted based on its contrast capability, resulting in a comprehensive anomaly score. A threshold is set based on the comprehensive anomaly score data to identify outliers. This serves as a basis for determining anomalies at each wavenumber point. When a wavenumber point's score exceeds the threshold, it is identified as a potential outlier, and a set of outlier points is constructed. Based on this set of outlier points, their spatial continuity and regional affiliation in wavenumber space are identified. A connection strategy is then employed to merge adjacent or highly similar outliers to form a larger, continuous outlier region. The boundaries of the spectral anomaly regions are extracted and analyzed to segment the transition between normal and anomaly regions, determine the spatial boundaries of the anomaly region, and obtain a set of boundary points.
[0028] Step S3: Based on the spectral abnormal area and the boundary point set, the spectral normal area is processed by the heat kernel function to obtain a multi-scale characteristic spectrum set and a normal reference area;
[0029] Specifically, a graph structure model is constructed in the wavenumber-intensity space of the raw Raman spectrum, reflecting the overall structural characteristics of the spectral data. Using a k-nearest neighbor strategy, all wavenumber points are treated as vertices in the graph. The similarity between adjacent wavenumber points is used as the edge weights of the graph. The connectivity between wavenumber points is defined by calculating the intensity differences between them, resulting in a complete spectral graph structure consisting of a vertex set, an edge set, and a weight matrix. The graph Laplacian matrix of this spectral graph is calculated, which integrates the connectivity strength of each wavenumber point with the relative balance of the overall structure. By performing eigendecomposition on this graph Laplacian matrix, a set of globally expressive Laplacian eigenvectors is extracted. These eigenvectors mathematically represent the optimal orthogonal basis of the spectral space and structurally reflect the dominant trends between spectral points. This set of eigenvectors is used to map the raw spectral data, compressing the high-dimensional wavenumber-intensity space into a more compact low-dimensional space, forming a low-dimensional manifold representation. Based on this low-dimensional manifold representation, parameterization operations are performed on the previously detected spectral anomalous regions. By extracting the boundary points of the anomalous region and combining their coordinate distribution in manifold space, the anomalous region, originally complex and irregular in wavenumber-intensity space, is mapped into a regularly defined rectangular region in parameter space. The entire spectral space is then viewed as a spectral Riemannian manifold, with the anomalous region embedded within it as a local void to be reconstructed, while the surrounding structure, which is continuous and stable, constitutes the well-defined normal region. Based on the spectral Riemannian manifold space, the normal region is processed using a heat kernel function. Leveraging the diffusion characteristics of this heat kernel function on the manifold, multi-scale modeling of the local and global structure of each wavenumber point in the spectrum is performed. By setting different heat diffusion time parameters, a multi-level feature spectrum collection, ranging from local details to overall trends, is obtained, reflecting the stability patterns of the spectrum at different structural scales. Furthermore, during this processing, a set of normal reference regions with the closest structural similarity to the anomalous region is selected by comparing the similarity between the anomalous and normal regions in terms of manifold structure and heat kernel diffusion characteristics.
[0030] A heat kernel function model is introduced in the spectral Riemannian manifold space. This heat kernel function simulates the process of heat propagation on a curved surface or manifold. Therefore, it can accurately capture the intrinsic similarity between any two points in the spectral space based on the geodesic distance between each point. In this process, the geodesic distances between all points in the normal spectral region and other points on the entire spectral Riemannian manifold space are calculated. These distances are the shortest path lengths along the manifold curvature and thus better reflect the true geometric relationships of the spectral structure. The process of obtaining this distance metric requires solving the geodesic paths based on the low-dimensional mapping space defined by the Laplace characteristic and using approximate numerical methods to generate a distance metric dataset covering all point pairs. Using these distance metric results, the heat kernel function is applied to each normal spectral point and its neighborhood, performing a weighted integration operation using the diffusion capacity at different scale parameters as weights. For each normal spectral point, the distance between it and its geodesic neighbor is substituted into the heat kernel function and weightedly accumulated with the original light intensity value to form a heat kernel characteristic representation of that point at a specific scale. In this way, heat kernel functions at different scales can respectively reflect the diversity and hierarchy of the spectrum in terms of detailed structure and overall trends. The resulting heat kernel signature is not only highly robust but also effectively filters out local noise or discontinuities. Heat kernel signature data is organized at multiple preset scales to construct a multi-scale feature spectrum collection that encompasses both local detailed features and global structural trends. This collection is categorized and managed by scale, with each scale corresponding to a thermal diffusion range. Smaller scales emphasize microstructure, while larger scales reflect macroscopic trends, forming a hierarchical feature representation system. From the normal region of the spectrum, based on the previously calculated manifold distance metric, the normal point set that is closest in geometric space to the boundary point set of the abnormal region is selected as a candidate. By comparing the positions of the boundary points in the low-dimensional manifold space with the positions of the normal region points, and selecting the region consisting of the points with the shortest distance, the most uniform distribution, and the most stable structure, the normal reference region with highly similar structural characteristics to the abnormal region is identified.
[0031] Step S4: performing gradient-guided reconstruction based on the multi-scale characteristic spectrum set and the normal reference area to obtain preliminary correction data of the spectral abnormality area;
[0032] Specifically, the anomalous parts of the spectral space are considered as missing fragments embedded in the manifold structure, namely holes, and a manifold hole-filling reconstruction model with geometric constraints and gradient guidance capabilities is constructed based on this spatial region. In this model, the reconstruction objective function is defined as minimizing the difference between the reconstructed spectrum within the anomalous region and the reference gradient field. The goal is to make the reconstructed spectrum not only close to the multi-scale characteristics of the reference region in terms of intensity value, but also to keep the gradient direction and variation trend as consistent as possible with the normal structure. Therefore, the objective function introduces both a gradient deviation term and a regularization control term. The former ensures that the reconstruction result can naturally expand along the reference gradient direction, and the latter is used to numerically constrain the discontinuity behavior in the reconstruction process, maintaining the smoothness and physical rationality of the overall spectral curve. To make the objective function practically solvable, key gradient information is extracted from the constructed multi-scale characteristic spectrum set as a guide for the reconstruction process. By analyzing the changing trends of the heat kernel characteristics of a normal reference region at different scales, a set of reference gradient fields at multiple diffusion scales is constructed. These gradient fields reflect the direction of spectral variation in both macroscopic configuration and microscopic details at different levels. These gradient fields are then weighted and fused according to structural similarity and boundary consistency to form a unified target gradient field. The target gradient field is introduced into the reconstruction function of the anomalous region as the expected gradient distribution direction, imparting propagation guidance to the spectral values in the anomalous region. This ensures that the reconstruction result not only approximates the characteristics of the normal region but also exhibits a clear gradient structure transition. The objective function for hole-filling reconstruction is formalized based on the variational principle. By minimizing the partial derivatives of the function, the optimization problem is transformed into a system of partial differential equations, resulting in a Poisson equation with structural control and boundary constraints. In this equation, the right-hand side is composed of the divergence of the target gradient field, while the boundary conditions are provided by the set of boundary points corresponding to the edges of the anomalous region. These boundary points record the actual light intensity information of the adjacent normal regions in the original spectral data and thus constitute the most important physical constraint, ensuring a smooth transition of the reconstructed curve at the edges without introducing numerical abrupt changes. To solve the Poisson equation in practical calculations, the entire anomaly region is discretized using finite elements in manifold space. By dividing the anomaly region into a set of topologically consistent triangular mesh elements and constructing local basis functions at each node, the continuous partial differential equation is transformed into a linear system with a sparse structure. During this process, the gradient and boundary terms are numerically approximated simultaneously, resulting in a solution framework consisting of a stiffness matrix and a load vector. By solving this linear system, preliminary corrected spectral values are obtained for each wavenumber point within the anomaly region.
[0033] Based on the restoration objective for the spectral anomaly region, an integral error expression is constructed in the spectral Riemannian manifold space to describe the difference between the reconstructed spectral gradient and the target gradient field. This expression uses the reconstructed spectral function to be solved within the anomaly region as a variable and the target gradient field derived from the normal reference region as a reference. An overall function is constructed that reflects the sum of the squares of the gradient differences between the two. This function is used to measure whether the directional variation of the reconstructed curve throughout the anomaly region is consistent with the normal structure. This integral error function structurally ensures that the restoration result naturally extends along physically plausible gradient directions. It not only pursues spectral fit but also emphasizes continuous transitions and directional integrity in wavenumber space. To obtain the mathematically optimal solution of this integral function, it is derived from the Euler-Lagrange equation. Starting from the variational principle, the first-order variation of the function is calculated for any small perturbation, and this variation is set to zero at the minimum point. This results in the partial differential equation that the reconstructed spectral function must satisfy. The core of this derivation lies in transforming the optimization problem into a variational problem and analytically identifying the necessary condition: the variational derivative of the function over the entire domain must be zero. This process ultimately leads to a standard elliptic partial differential equation, essentially corresponding to a Poisson-type model. The term to be solved is the spectral intensity function, while the right-hand side of the equation is formed by the divergence of the target gradient field, representing the expected intensity variation trend within the entire structure. Considering the significant geometric differences in the actual spectral structure within different anomalous regions, especially in areas where the spectral curve experiences sharp bends or mutations, the original gradient control term is insufficient to suppress numerical fluctuations or boundary discontinuities. Therefore, a spatially varying adaptive regularization term is introduced into the basic objective function. This regularization term automatically adjusts its value based on the curvature characteristics of each point on the manifold space. In regions of high manifold curvature, where the spectrum undergoes wrinkles or mutations, the regularization strength is reduced to maintain the degree of freedom of the gradient direction. In regions of low curvature and smoother areas, the regularization term is increased to ensure high stability and numerical continuity during the spectral reconstruction process. After completing the regularization correction, the improved objective function is re-executed with variational calculus. By performing partial integration and variational derivation on the gradient term, regularization term, and boundary constraint term contained in the function, the complete Poisson equation form is obtained. The solution region of this equation is limited to the spectral anomaly region, and its boundary conditions are clearly provided by the original spectral values collected from the boundary point set, ensuring that the spectral intensity at the boundary during the repair process strictly matches the actual measurement data, thereby avoiding boundary offsets caused by artificial interpolation. By embedding these boundary values into the solution space of the Poisson equation, a set of complete partial differential models that conform to the gradient-guided trend, regularized smoothing regulation, and boundary value consistency are finally obtained.
[0034] Step S5: Perform layer-guided repair on the preliminary correction data of the spectral abnormality area to obtain corrected spectral information.
[0035] Specifically, the preliminary correction data is decomposed into three structural layers based on the morphological composition of the spectral signal: the baseline configuration layer, the broad peak structure layer, and the detailed characteristic peak layer. This layering process is based on an analysis of the structural characteristics of the spectral curve. The baseline configuration layer corresponds to the low-frequency fluctuations and trend-based intensity background portion of the spectrum and is the foundation of the entire spectral profile. The broad peak structure layer includes main peaks or envelope peaks with smooth waveforms and large half-widths, reflecting the main components of the target substance. The detailed characteristic peak layer includes high-frequency details such as sharp peaks, secondary peaks, and edge perturbations, which are important for distinguishing complex mixtures and trace substances. Through multi-level structural division, the variation patterns of different spectral levels are modeled and processed separately, avoiding the loss of details or oversmoothing caused by a single repair process that applies to all structures. The repair process begins with the most basic configuration layer, using the first-scale characteristic spectrum with the longest thermal diffusion time as a guiding template. While maintaining the structural profile, the baseline portion of the preliminary correction result is comprehensively guided and corrected. The first-scale characteristic spectrum represents the global heat core signature. Its high smoothness and insensitivity to small perturbations effectively eliminate baseline drift and trend discontinuities caused by noise or missing data during the restoration process, resulting in a baseline restoration with structural continuity and a stable background. Based on this baseline restoration, the intermediate broad peak structure layer is processed, introducing a mid-scale characteristic spectrum as a guide. This achieves both local sensitivity and sufficient structural stability. Using the characteristic spectrum at this scale, the restored baseline is reprocessed, guiding the broad peak morphology to refit to the statistical distribution of the normal reference region, resulting in a broad peak restoration with authentic chemical structural characteristics. During this stage, the focus is on addressing main peak profile distortion, peak width anomalies, or intensity discordance caused by missing or distorted data in anomalous regions, ensuring that the restored data is consistent with the global structural trend and physically interpretable for the local peak shape. The detailed restoration of the characteristic peak layer then proceeds to the refined restoration stage, where the third-scale characteristic spectrum, with the shortest thermal diffusion time and highest resolution, is selected as the guiding template. Since the characteristic spectrum at this scale is more sensitive to high-frequency changes and small disturbances, it can accurately capture the detailed outlines of sharp features in the original spectrum. Therefore, during the repair process, it has good fitting capabilities for key indicators such as the peak position, peak height and symmetry of the characteristic peaks. When performing this fine repair, not only the reconstruction accuracy of the detail peak in the intensity distribution is considered, but also the local similarity between it and the reference spectrum is compared to ensure that no new spectral line artifacts are introduced while completing the peak shape restoration. After a hierarchical guided repair process from baseline to broad peak to detailed characteristic peaks, the preliminary correction data is gradually refined into corrected spectral information with complete structure, realistic morphology and clear details.
[0036] In embodiments of the present invention, a multi-layer gradient flow field model is constructed, enabling anomaly detection to be independent of pre-defined peak shapes or statistical models. This allows for a more comprehensive capture of the dynamic characteristics of the spectrum and improves adaptability to unknown backgrounds and complex peak shapes. The anomaly detection method based on flow field topology analysis can automatically determine the optimal detection scale, achieving higher accuracy for different types of anomaly regions (such as spectral drift, peak position shift, and intensity anomalies), particularly for complex anomalies that are difficult to identify with traditional methods. Treating the spectral space as a Riemannian manifold and parameterizing it accurately describes the topological relationship between anomaly and normal regions, better preserving the structural integrity and continuity of the spectrum during the correction process. Multi-scale feature extraction in the manifold space using a heat kernel function simultaneously captures both the global structure and local details of the spectrum. A hierarchical guided repair strategy is employed, sequentially performing fine correction from baseline configuration to broad peak structure and then to detailed characteristic peaks. This effectively avoids the oversmoothing problem common in traditional global optimization methods and better preserves the spectral details. Spectral repair is achieved through a manifold hole-filling algorithm and the solution of the Poisson equation, ensuring a smooth transition between the corrected spectrum and the original normal region at the boundaries of the anomaly region, eliminating repair artifacts and discontinuities. Physical constraints such as non-negativity constraints and peak position retention constraints are introduced during the correction process to ensure that the correction results conform to the physical mechanism of Raman spectroscopy and avoid the generation of spectral characteristics that are inconsistent with reality.
[0037] In a specific embodiment, the process of executing step S1 may specifically include the following steps:
[0038] Perform laser scanning excitation on the sample in the fiber confocal micro-Raman spectroscopy system to obtain raw spectral data;
[0039] Perform discrete gradient calculation on the original spectral data to obtain the initial velocity field data;
[0040] Apply the Gaussian kernel function to perform convolution operation on the initial velocity field data to obtain multi-scale velocity field data at different scales;
[0041] Based on the multi-scale velocity field data at different scales, the flow field divergence characteristics at each scale are calculated to obtain the flow field characteristic parameters. The flow field characteristic parameters are then organized and arranged at different scales to obtain multi-layer gradient flow field characterization data.
[0042] Specifically, a high-precision, high-spatial-resolution fiber-optic confocal Raman microscope system is used to perform laser scanning excitation on the target sample. During this process, a precise scanning mirror assembly controls the laser beam to excite microscopic locations on or within the sample point by point. Each excitation point generates a scattered signal with a characteristic wavenumber due to the Raman scattering effect. These signals are transmitted via optical fiber to a highly sensitive detector array and converted into a spectral image by a wavenumber resolution module. This yields a raw spectral data set covering the selected scanning range. This set contains the light intensity response of each spatial sampling point across multiple wavenumber bands, represented as a series of discrete wavenumber-intensity data points. The raw spectrum is treated as a sequence of structures with continuously varying characteristics in wavenumber space, and a discrete gradient calculation is performed on it to reveal the local trend of spectral variation in the wavenumber dimension. By comparing the intensity differences between adjacent wavenumber points, the local gradient value at each wavenumber point is calculated. This gradient describes the upward or downward trend of the spectrum at that point, forming a conceptual structure similar to a velocity field. In this sense, the intensity gradient at each wavenumber point can be analogized to a "flow direction," that is, the trend of spectral variation within that interval. Therefore, this initially formed gradient field serves as the initial velocity field data, providing a first-level structural description of spectral morphological variations from a spatial geometric perspective. Raman spectral data simultaneously contain information at multiple scale levels, such as large-scale background drift, broad peak structures, narrow peak features, and micro-perturbations, resulting in multi-layered superposition effects. Therefore, velocity fields are modeled at different observation scales. To extract features at different scales, a Gaussian kernel function is introduced as a smoothing convolution tool. By convolving the initial velocity field with Gaussian kernels of different scale parameters, velocity field representations at multiple observation scales are generated. Larger scales produce smoother velocity fields, reflecting spectral structural trends over a wider range. Smaller scales retain more local details and are more sensitive to small fluctuations. By setting multiple scale parameters and performing convolutions one by one, a velocity field sequence containing multi-level information is obtained. The divergence of the velocity field data at each scale is calculated. Divergence, an indicator of the degree of flow variability within a vector field, reveals whether the velocity field tends to diverge or converge within a certain wavenumber interval. In normal spectral regions, which exhibit continuous laminar flow, the velocity field divergence is numerically stable. However, when encountering abnormal structures, peak breaks, background mutations, or noise interference, the local velocity field exhibits a drastic change or rotational trend, resulting in a significant increase in divergence. Therefore, quantitative analysis of divergence can capture spectral anomalies at different scales. All divergence results are uniformly arranged according to their corresponding scale order, constructing a set of flow field characteristic parameters with a scale hierarchy. This yields multi-layer gradient flow field characterization data.
[0043] In a specific embodiment, the process of executing step S2 may specifically include the following steps:
[0044] Calculate the divergence value of the velocity field at each scale in the multi-layer gradient flow field characterization data to obtain the divergence data;
[0045] Anomaly score calculation is performed based on the divergence data to obtain the initial anomaly score value of each wave number point, and the initial anomaly score value is fused with multi-scale weighted fusion to obtain the comprehensive anomaly score data;
[0046] According to the comprehensive anomaly score data, a threshold is set to determine the anomaly point, and an anomaly point set is obtained. The adjacent anomaly points in the anomaly point set are connected to obtain the spectral anomaly area.
[0047] The boundary of the abnormal spectral area is extracted and analyzed to obtain a set of boundary points at the junction of the normal area and the abnormal area.
[0048] Specifically, the divergence characteristics of the velocity fields at each scale in the multi-layer gradient flow field characterization data, that is, the velocity variation curve at each specific smooth scale, are calculated in the wavenumber dimension. Divergence is an important indicator for measuring the trend of local changes in the velocity field. It reflects whether the spectral intensity variation trend near a certain wavenumber point is contracting or diffusing. Physically, it is analogous to whether the "signal flow" at that point is cohesive or divergent. In the context of Raman spectroscopy analysis, the spectral curve in normal areas exhibits smooth, locally monotonic changes, so the corresponding velocity field divergence value fluctuates little within a continuous wavenumber interval. However, when abnormal structures such as noise interference, background mutations, or peak breakage appear in the spectrum, the direction of velocity variation at that location will undergo a significant abrupt change, resulting in a dramatic change in local divergence. By calculating the divergence of the velocity field at each scale, potential abnormal signal characteristics at each scale are captured. Anomaly scores are calculated based on the divergence data. For each wavenumber point, an anomaly scoring function is constructed. This function is based on the divergence value of the point at the current scale and normalized with the relative energy level of the velocity field at that scale. This yields a relative anomaly index, reflecting whether the wavenumber point exhibits abrupt velocity changes at the current scale. To ensure comparability of scores across scales, the anomaly scoring function must possess good normalization properties, such as by dividing by the global norm of the velocity field at that scale to suppress scale-induced shifts in the score distribution. After initial anomaly scores are generated at all scales, they are fused into a global evaluation index, constructing a multi-scale weighted fusion model. This fusion model assigns an adaptive weight coefficient to each scale, giving higher contributions to scores that are more discriminative between normal and anomalous regions at certain scales. This weight coefficient is adjusted based on the variance ratio of the score data between normal and global regions, automatically increasing the influence of scores calculated at scales with higher discriminative power. This mechanism effectively highlights wavenumber points that exhibit anomalous trends across multiple scales while suppressing noise points that exhibit abrupt changes at only a single scale but are not globally significant. A threshold is set based on the comprehensive anomaly score data to determine anomalies. The threshold is selected based on statistical analysis, such as selecting a certain quantile in the score distribution, or setting the optimal distinguishing point based on the overlapping area of the score distribution of abnormal and normal areas in the training sample. Based on the threshold, all wavenumber points exceeding the threshold are marked on the score curve and used as the initial set of anomaly points. Adjacent anomaly points in the anomaly point set are connected. Adjacent wavenumber points in the anomaly point set are aggregated, and multiple consecutive anomaly points are merged into a complete anomaly region. The sequence of anomaly points is traversed, and the consecutively numbered point segments are identified and classified as the same anomaly segment, thereby generating multiple independent but internally continuous sets of spectral anomaly regions.To extract the spatial transition relationship between anomalous regions and normal spectral regions, a boundary extraction operation is performed on the anomalous regions. This identifies the outermost wavenumber points where each anomalous region contacts its adjacent normal regions. These boundary points physically represent the interface where the spectrum transitions from normal to anomalous behavior. They serve as boundary constraints in the subsequent solution of the Poisson equation, ensuring continuity between the inpainted anomalous regions and the real data. Furthermore, they serve as important anchor points for target gradient field matching and error optimization during reconstruction.
[0049] In a specific embodiment, the process of executing step S3 may specifically include the following steps:
[0050] The k-nearest neighbor graph is constructed for the original spectral data in the wavenumber-intensity space to obtain a spectral graph structure that represents the connection relationship between spectral points. The spectral graph structure includes a vertex set, an edge set, and a weight matrix.
[0051] Calculate the graph Laplace matrix according to the spectral graph structure, and perform eigendecomposition on the graph Laplace matrix to obtain the Laplace eigenvector set;
[0052] The Laplace eigenvector set is used to map the spectral abnormal area and its surrounding normal area to obtain a low-dimensional manifold representation.
[0053] The spectral anomaly region is parameterized based on the low-dimensional manifold representation to obtain the spectral Riemannian manifold space, which represents the spectral anomaly region as a regular parameter region.
[0054] Based on the spectral Riemannian manifold space, the heat kernel function is processed on the normal region of the spectrum to obtain a multi-scale characteristic spectrum set and a normal reference region.
[0055] Specifically, based on the structural characteristics of the original spectral data, a k-nearest neighbor graph model is constructed in the wavenumber-intensity space, which can express the similarity between points and the local geometric structure. This model uses each wavenumber point as a vertex in the graph structure. By calculating the Euclidean distance between it and other points in the direction of light intensity, the k adjacent points with the smallest distance are selected to establish edge connection relationships, forming a graph structure with local neighborhood characteristics. Each edge represents the adjacent relationship between two wavenumber points in the original spectrum, and its edge weight is defined by the distance function. In other words, a weight matrix reflecting the strength of similarity is constructed, so that the connection weight of points with close distance and consistent change trends is higher, while the connection weight of points with distant distance or opposite fluctuation directions is lower. This spectral graph structure consists of a vertex set, an edge set, and a weight matrix corresponding to the edge set, which fully preserves the spatial continuity, local fluidity, and overall morphological structure of the original spectral data. After the spectral graph structure is constructed, the spatial geometric relationships implicit in the graph structure are extracted. This process relies on the eigendecomposition of the graph Laplacian operator. Based on the graph's weight matrix, a corresponding degree matrix is calculated, where each diagonal element represents the sum of the connection weights between a vertex and its neighbors. The difference between the degree matrix and the weight matrix then forms the graph's Laplacian matrix. This matrix reflects the global nature of the coupling relationships between points in the spectral graph structure and is an important tool for describing the "diffusion" or "tension" behavior within the graph. By performing eigenvalue decomposition on the Laplacian matrix, a set of corresponding Laplacian eigenvectors is obtained. These eigenvectors are considered to represent the basis functions of the graph structure at different frequency dimensions, sequentially characterizing the macroscopic profile and local details of the spectral points from low to high frequencies. Using this set of Laplacian eigenvectors, each wavenumber point in the spectral graph is remapped to a low-dimensional coordinate space, known as a low-dimensional manifold representation space. During this transformation, each wavenumber point is projected into a new low-dimensional coordinate point. The geometric structure of these points in the low-dimensional space preserves their relative topological relationships in the high-dimensional space as much as possible, especially maintaining connectivity consistency in the local structure. Therefore, this low-dimensional space is called the intrinsic geometric manifold of the spectral data. In this manifold space, the distribution of spectral points can better reflect its essential change trend, without being affected by high-dimensional noise disturbances or nonlinear structures. In particular, for normal points near the abnormal region and its boundary, the difference in their coordinate positions in the low-dimensional manifold space is more obvious, thus providing a geometric measurement basis for subsequent anomaly detection, structural normalization, and repair template matching operations. Based on the low-dimensional manifold representation, the spectral abnormal region is parameterized, and the irregular abnormal region is re-expressed in the manifold as a regular two-dimensional parameter region, which facilitates the subsequent modeling and numerical processing using standard mathematical methods. By extracting the boundary point set of the abnormal region in the low-dimensional space and establishing a bidirectional mapping relationship between it and the two-dimensional parameter domain, a set of continuous transformation functions from the unit square or unit rectangle to the abnormal region is constructed.This mapping function covers all internal points of the anomaly region and aligns the boundary structure, making the parameterized region uniform, stable, and analytical in numerical processing. The mapping of all anomaly regions in the manifold space is normalized to a regular parameter domain, thus forming a spectral Riemannian manifold space. Using the spectral Riemannian manifold space as the function domain, a heat kernel function is applied to the normal region to extract a multiscale feature spectrum set and identify a normal reference region. Based on the principle of heat diffusion, this process defines the geodesic distance between any two points in the manifold space and uses this distance as the core variable of the heat kernel function to model the strength of the mutual influence between points. At different heat diffusion scales, the heat kernel function reflects the trade-off between local detail and global structure. By performing weighted integral operations on the spectral points of the normal region at multiple scales, a series of heat kernel features with representative structures at different scales are obtained. These features constitute a multiscale feature spectrum set that can describe the behavioral patterns of the normal spectrum from coarse to fine. At the same time, by comparing the geometric distances between the boundary points of the abnormal area and the points of the normal area in the manifold space, the normal reference area with the most similar structure to the abnormal area is screened out, and a repair template with comparability and local consistency is constructed.
[0056] In a specific embodiment, the step of performing heat kernel function processing on the normal region of the spectrum based on the spectral Riemannian manifold space to obtain the multi-scale characteristic spectrum set and the normal reference region may specifically include the following steps:
[0057] The heat kernel function is introduced into the spectral Riemannian manifold space, and the geodesic distance between the normal spectral point and other points on the spectral Riemannian manifold space is calculated to obtain the distance metric data.
[0058] Based on the distance metric data, the heat kernel weighted integral operation is performed on the normal spectrum data under different scale parameters to obtain the heat kernel characteristic data;
[0059] The thermal nuclear characteristic data are organized and sorted at multiple preset scales to obtain a multi-scale characteristic spectrum set containing local details and global structural information;
[0060] A manifold distance metric comparison is performed from the spectral normal regions to identify the normal reference regions corresponding to the set of boundary points.
[0061] Specifically, the study is based on the spectral Riemannian manifold space. This space uses a low-dimensional embedding technique to map spectral points in the original wavenumber-intensity space into a set of low-dimensional coordinates that preserves the topological structure. The position of each spectral point within the manifold reflects its similarity to other points in terms of variation trends, structural morphology, and local fluctuations. Within this low-dimensional structure, precise measurements between point pairs are performed based on the geodesic distance within the manifold. To this end, a heat kernel function is introduced within the Riemannian manifold space. This function, essentially derived from the solution of the heat conduction equation on a surface, is constructed based on the geodesic distance between any two points and uses a time scale parameter as a control factor to control the spatial range and local sensitivity of heat diffusion. For any two spectral points on the manifold, when the geodesic distance between them is short, the heat kernel function value is high, indicating that heat diffuses easily between the two points, thus suggesting a high degree of structural similarity. On the other hand, for pairs of points farther apart, the heat kernel value decays rapidly, reflecting structural differences. A heat kernel function is introduced to calculate geodesic distances for all pairs of spectral points in a Riemannian manifold space. This process employs an approximate calculation method based on a graph shortest path algorithm. For example, by constructing a k-nearest neighbor graph and then executing path optimization methods such as the Dijkstra algorithm or the Floyd-Warshall algorithm on the graph, a geodesic length matrix between all pairs of points is obtained, generating distance metric data. Based on this distance metric data, a heat kernel weighted integral operation is performed on normal spectral data at different scale parameters. This integral process can be numerically viewed as fixing a central point, using the heat kernel values between that point and all other spectral points as weights, and then performing a weighted summation based on the original spectral intensity information of these points to obtain the heat kernel eigenvalue of the central point at the current heat diffusion scale. In this way, the heat kernel eigenvalue not only incorporates the information of the point itself but also incorporates the behavior of its neighborhood on the manifold structure, thus possessing a certain degree of structural robustness and denoising capabilities. The results of the heat kernel weighted integration show different levels of structural response depending on the diffusion scale: when the scale is small, the diffusion range of the heat kernel function is limited to the local neighborhood of the point, and the results are more sensitive to details and noise structure; when the scale is large, the coverage of the heat kernel function expands, and the integration results are more able to reflect the global structure and trends. To achieve multi-level feature extraction, multiple preset heat diffusion scales are set, and the heat kernel weighted integration calculation is repeated for each spectral point in the normal area. After completing the integration at different scales, the heat kernel feature results at all scales are systematically sorted to construct a characteristic spectrum set composed of multi-scale heat kernel features. In this set, each layer corresponds to a specific scale parameter, and each point has a set of heat kernel response values at this scale. These response values together describe the characteristic performance of the point at different structural levels.By vertically examining the heat kernel feature sequence of a certain point at all scales, its behavioral consistency in detail level, mesoscale contour and global structure is determined; and by horizontally comparing the distribution of feature values of different points at the same scale, the similarity or abnormality of different structural regions is identified. The part closest to the structure of the abnormal region is selected from the normal region as a reference template for spectral restoration. Starting from the set of boundary points in the abnormal region, the geodesic distances between the boundary points and each point in the normal region are compared one by one in the manifold space, and the points with the shortest distance, closest structure and uniform distribution are selected as candidate reference points. In order to ensure the representativeness and wide coverage of the reference area, a distance threshold is set and selected in combination with the structural distribution density, and finally a set of normal reference areas with spatial consistency and spectral feature similarity is formed.
[0062] In a specific embodiment, the process of executing step S4 may specifically include the following steps:
[0063] Construct a manifold hole filling and reconstruction objective function for spectral anomaly areas;
[0064] Target gradient field construction is performed based on multi-scale characteristic spectrum set and normal reference area to obtain spectral gradient information;
[0065] The variational principle is applied to the objective function of manifold hole filling and reconstruction to obtain the Poisson equation, which takes the boundary point set of the spectral anomaly region as the boundary condition.
[0066] The Poisson equation is discretized and solved to obtain preliminary correction data for the spectral abnormal area.
[0067] Specifically, the structural representation of the spectral abnormal region is clarified. In the spectral Riemann manifold space, the abnormal region is denoted as ,in Represents the wavenumber interval to be repaired, corresponding to the continuous wavenumber subset where strong distortion, missing or structural distortion occurs in the original spectrum; its boundary is denoted by It represents the set of wave number points where the abnormal region is adjacent to the normal spectral region. Represents the partial differential symbol. The light intensity at these boundary points is known and can be used as boundary constraints. Suppose the spectral function to be reconstructed is ,in Indicated in wave number The reconstructed light intensity value on Represents the wave number variable, which is the independent variable of the spectral curve. In order to construct a structural prior that has a guiding role in the reconstruction trend, the target gradient field is introduced. , which is used to describe the expected intensity change rate in the wavenumber dimension, and is derived from the multi-scale thermal nuclear characteristics of the normal reference region. Assume that the reference thermal nuclear characteristic spectrum is ,in Indicates the A reference spectrum on the scale The characteristic spectrum below; represents the scale index, Represents the heat diffusion time parameter, which is used to control the diffusion range of the heat kernel function. The larger the scale, the more it reflects the global structure, and the smaller the scale, the more it reflects the local details. The gradient field at each scale is defined as:
[0068] ;
[0069] in It is The derivative of the spectral intensity with respect to the wave number at a scale represents the local rate of change at that scale. Representation function For variables The first derivative of (wave number), that is, the rate of change of spectral intensity with respect to wave number, Represents the differential operator. The gradient fields at multiple scales are weighted fused to form a comprehensive target gradient field:
[0070] ;
[0071] in It is The weight coefficient of each scale, Indicates the total number of scale layers considered. The larger the weight, the stronger the contribution of the gradient feature of that scale to the overall structure guidance. In order to make the fused gradient field close to the real observed spectrum at the boundary point, the weight coefficient is optimized to minimize the boundary fitting error:
[0072] ;
[0073] in Indicates that the original spectrum is at the boundary point The true observation value on is the regularization coefficient, which is used to prevent weight overfitting. After establishing the target gradient field, the reconstruction objective function is constructed, which is in the form of:
[0074] ;
[0075] in is a function In the area Upper and target gradient fields The square integral value of the gradient difference is the cost function of the entire reconstruction optimization; represents the gradient term of the spectrum to be reconstructed, represents the square norm, and the integral operation reflects the global evaluation of the degree of fitting in the entire abnormal area. In order to solve the spectral function that minimizes the objective function , using the calculus of variations, setting its first-order variation to zero, we can obtain the necessary conditions. According to the Euler-Lagrange equation, we have:
[0076] ;
[0077] The left side is the second-order derivative of the spectral reconstruction function, indicating its curvature in the wavenumber dimension; on the right is the derivative of the target gradient field, which represents the gradient change rate. This form is exactly the expression of the Poisson equation in a one-dimensional structure, formally recorded as:
[0078] ;
[0079] in represents the Laplace operator, which is the second-order derivative in one dimension. is the divergence of the target gradient field (derivative in one dimension), which represents the weighted slope change in the wavenumber direction. To solve the Poisson equation, it is discretized. Assume that the abnormal wavenumber interval is evenly divided into points, for any interior point , use central differences to approximate the second-order derivative:
[0080] ;
[0081] in is the wave number spacing, Is the first The reconstructed values of wave number points. Extending it to matrix form, we can get the linear equation system:
[0082] ;
[0083] in is a tridiagonal sparse coefficient matrix with dimension , used to implement discrete Laplacian operations; is a column vector of unknown variables, expressed in Reconstructed spectral values of all wavenumber points in the region; is the right-hand divergence term, i.e. To ensure the physical continuity of the solution, the real spectral values of the boundary points are introduced into the system as boundary conditions, that is:
[0084] ;
[0085] What we finally get This is the preliminary correction result of the abnormal area, which strictly matches the real observation value at the boundary and generates a smooth and continuous spectral morphology in the internal area guided by the target gradient to ensure physical coherence and structural interpretability.
[0086] In a specific embodiment, the step of performing variational principle processing on the manifold hole filling and reconstruction objective function to obtain the Poisson equation, and the process of the Poisson equation using the boundary point set of the spectral abnormal region as the boundary condition can specifically include the following steps:
[0087] Based on the manifold hole filling reconstruction objective function, a function expression is created to represent the integrated square error between the reconstructed spectral gradient and the target gradient field;
[0088] The Euler-Lagrange equation is used to derive the function expression and obtain the necessary conditions for the optimal solution. The necessary conditions for the optimal solution are characterized by the function variation being zero at the minimum point;
[0089] Based on the manifold curvature characteristics of different regions in the spectral anomaly area, a spatially varying adaptive regularization term is introduced into the function expression to obtain an improved objective function.
[0090] The improved objective function is subjected to variational calculus operations to obtain the Poisson equation. The spectral values in the boundary point set of the spectral anomaly region are used as the boundary conditions of the Poisson equation.
[0091] Specifically, the reconstruction problem of the abnormal region is modeled from the spectral Riemann manifold space, and the abnormal region is recorded as , which represents the signal missing section in the Raman spectrum due to instrument drift, background interference or incomplete sampling. Boundary point set The wave number point at the junction of the abnormal region and the normal spectral region has a real observation value and serves as the physical boundary condition. Let the reconstructed spectrum function be , indicating that at the wave number point In order to make the reconstruction curve consistent with the change trend of the normal spectral region in the gradient direction, the target gradient field is introduced , which is composed of a multi-scale reference feature set Composition, of which represents the thermal diffusion scale layer, Indicates the reference spectrum sample number, For the The sample in The heat kernel features extracted at different scales are obtained through scale-weighted fusion:
[0092] ;
[0093] in represents the target gradient field, is the scale weight coefficient, controlling the The degree to which the layer scale affects the final gradient guidance, It is on scale Next The spectral change rate of the reference sample. This expression ensures that the guided gradient not only integrates multi-scale information but also adapts to the scale variation of the actual structure. A reconstruction energy function is constructed to reflect the difference between the reconstruction function and the guided gradient field. This function should be expressed as the global deviation between the reconstructed gradient and the target gradient in the abnormal region, so the following target functional is defined:
[0094] ;
[0095] in is the unregularized reconstruction loss function, is the derivative of the reconstruction function, indicating its actual gradient, is the expected gradient, and the difference between the two reflects the deviation direction; is the local manifold metric tensor, used to represent wave number points in the Riemannian manifold space The geometric weight of the nearby gradient field change is essentially a positive symmetric matrix, which is used to adjust the contribution strength of the error at each point in different directions. In order to improve the stability of the reconstruction function in a physical sense and implement flexible adjustment of the mutation area, an adaptive regularization term is introduced. This term should take into account the curvature change of the spectral Riemann manifold at different positions. Let the curvature function be , which describes the manifold at the point The local curvature of , the larger the value, the point is located at an abnormal mutation position or a structural inflection. According to the curvature-guided regularization idea, the regularization coefficient is defined as:
[0096] ;
[0097] in represents the adaptive regularization strength, is the minimum canonical strength constant, is the attenuation factor, Controls the sensitivity of curvature changes. This function ensures smooth areas with small curvature When the regularization term is close to , emphasizing structural consistency; and at the point where the curvature suddenly changes hour , retaining gradient flexibility. Therefore, the objective function after introducing the regularization term is:
[0098] ;
[0099] in represents the spectral value of the prior estimate, which is obtained by spline interpolation of the wavenumber segments before and after the abnormal area; the second term is the structural consistency regularization term, which is used to penalize the deviation of the reconstructed value from the prior structure; Then control the penalty intensity of this item at different positions. Perform variational calculus, that is, Taking the minimization condition of the first-order variation of , and applying the generalized Euler-Lagrange equation, we obtain the following high-order partial differential equation:
[0100] ;
[0101] This is a non-uniform generalized Poisson equation with structural weighting terms and spatially varying regularization control. The first term is the structural control derivative of the gradient error, and the second term is the position-dependent prior offset correction term. In the discrete implementation, the equation is discretized into a system of linear equations using the finite difference method, where the weight matrix and regularization term They are dynamically adjusted according to the curvature field and the reference set, and the boundary conditions are given by:
[0102] ;
[0103] It is forced to be introduced to ensure that the reconstruction results of the abnormal area are consistent with the original observations at the boundary points.
[0104] In a specific embodiment, the process of executing step S5 may specifically include the following steps:
[0105] The preliminary correction data of the spectral abnormal area are layered to obtain the baseline configuration layer, the broad peak structure layer and the detailed characteristic peak layer;
[0106] Apply the characteristic spectrum at the first scale to perform guided repair on the baseline configuration layer to obtain the baseline repair result;
[0107] Based on the baseline repair results, the characteristic spectrum at the second scale is used to guide the repair of the broad peak structure layer to obtain the broad peak repair result;
[0108] According to the results of broad peak restoration, the characteristic spectrum under the third scale is used to perform fine restoration on the detail characteristic peak layer to obtain the corrected spectral information.
[0109] Specifically, the spectral data after preliminary correction undergoes a structural decomposition, dividing it into three levels corresponding to different physical sources and structural properties. The spectrum is considered a structural complex composed of three distinct frequency response components. The baseline configuration layer describes the low-frequency trends of the spectrum, arising from sample background, substrate drift, or instrument response. This appears as a slowly rising or falling curve, which has no direct significance for the actual composition of the substance, but significantly influences the overall curve shape. The broad peak structure layer represents the main components of the spectrum, corresponding to the main chemical bond vibration peaks. These peaks are typically full-bodied and have large half-widths, making them key indicators for identifying compound class or concentration. The detailed feature peak layer represents the high-frequency portion, reflecting secondary components, trace impurities, or specific resonance behavior. Although their signal amplitudes are small, they possess extremely high specificity and discriminative value. After stratification is complete, the first stage of repair begins, which involves correcting the baseline configuration layer. In this stage, the smoothest first-scale features in the characteristic spectrum are selected. Features at this scale have a consistent global trend and accurately represent the spectral background shape. During the restoration process, the baseline within the abnormal region is refitted by referencing the trend distribution of the normal region at that scale. This eliminates sudden changes and smoothes out local fluctuations, constructing a smooth, continuous baseline layer with consistent boundaries. After baseline restoration is complete, the second stage begins: restoration of the broad peak structure. The characteristic spectrum at the second scale is used, which has a stronger ability to express local structure and better reflects the peak body contour and principal component response. During processing, a separation operation is performed based on the restored baseline layer. The difference between it and the original data is used as the basis for broad peak fitting. This is then compared and adjusted with the second-scale features. This ensures that the restored main peak contour maintains its normal symmetry, width, and intensity distribution, avoiding peak position shifts, waveform deformation, or energy mutations, ensuring a seamless structural integration with the normal spectrum. The third stage of restoration then proceeds, involving detailed processing of the high-frequency detail layer. In this stage, the characteristic spectrum at the third scale is used to guide the restoration, as it has the highest spatial resolution and can capture subtle structural features such as sharp peaks, short-period perturbations, or edge peak changes. Detail restoration relies on the stable foundation provided by the first two layers of structure, and performs high-precision peak position adjustment, intensity compensation, and morphological reconstruction in local areas, thereby restoring characteristic signals that are blurred, weakened, or even disappeared in abnormal areas. After three layers of restoration, the three results are recombined to construct the final corrected spectrum, which is consistent with the normal reference area in terms of overall trend, main peak structure, and detailed features. It is not only visually smooth and coherent, but also has a clear functional distribution at the structural level. Taking a certain Raman spectrum as an example, if the abnormal area appears in a position with a wide wavenumber range, containing two main peaks and several detailed fluctuations, the background drift phenomenon is eliminated after the first stage of restoration; in the second stage, the two main peaks are restored to a symmetrical and full structure; in the third stage, the tiny fluctuations on the shoulders of the main peaks are also restored, so that the entire spectrum regains its structural integrity and analytical value.
[0110] The above describes the spectral information correction method of the spectral abnormal region in the embodiment of the present invention. The following describes the spectral information correction system of the spectral abnormal region in the embodiment of the present invention. Figure 2 An embodiment of a system for correcting spectral information of a spectral abnormality region according to an embodiment of the present invention includes:
[0111] An acquisition module is used to collect raw spectral data through a fiber confocal micro-Raman spectroscopy system and perform multi-scale gradient analysis to obtain multi-layer gradient flow field characterization data;
[0112] The analysis module is used to perform flow field topology analysis on the multi-layer gradient flow field characterization data to obtain the spectral abnormal area and boundary point set;
[0113] A processing module is used to perform heat kernel function processing on the normal spectral area based on the spectral abnormal area and the boundary point set to obtain a multi-scale characteristic spectrum set and a normal reference area;
[0114] A reconstruction module is used to perform gradient-guided reconstruction based on a multi-scale characteristic spectrum set and a normal reference area to obtain preliminary correction data for the spectral abnormality area;
[0115] The repair module is used to perform layered guided repair on the preliminary correction data of the spectral abnormality area to obtain the corrected spectral information.
[0116] By integrating these components, a multi-layer gradient flow field model is constructed. This allows anomaly detection to be independent of pre-defined peak shapes or statistical models, more comprehensively capturing the dynamic characteristics of the spectrum and improving adaptability to unknown backgrounds and complex peak shapes. The anomaly detection method based on flow field topology analysis automatically determines the optimal detection scale, achieving higher accuracy for different types of anomaly regions (such as spectral drift, peak position shift, and intensity anomalies), particularly for complex anomalies that are difficult to identify with traditional methods. Parameterizing the spectral space as a Riemannian manifold accurately describes the topological relationship between anomaly and normal regions, effectively preserving the structural integrity and continuity of the spectrum during the correction process. Multi-scale feature extraction within the manifold space using a heat kernel function simultaneously captures both the global structure and local details of the spectrum. A hierarchical guided repair strategy, sequentially fine-tuning the correction from baseline configuration to broad peak structure and then to detailed characteristic peaks, effectively avoids the oversmoothing problem inherent in traditional global optimization methods and better preserves spectral detail. Spectral repair is achieved through a manifold hole-filling algorithm and the solution of the Poisson equation, ensuring a smooth transition between the corrected spectrum and the original normal region at the boundaries of the anomaly region, eliminating repair artifacts and discontinuities. Physical constraints such as non-negativity constraints and peak position retention constraints are introduced during the correction process to ensure that the correction results conform to the physical mechanism of Raman spectroscopy and avoid the generation of spectral characteristics that are inconsistent with reality.
[0117] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0118] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0119] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for correcting spectral information of spectral abnormality areas, characterized in that: include: The fiber optic confocal micro-Raman spectroscopy system was used to collect raw spectral data and perform multi-scale gradient analysis to obtain multi-layer gradient flow field characterization data; Performing flow field topology analysis on the multi-layer gradient flow field characterization data to obtain a spectral abnormality region and a boundary point set; Based on the spectral abnormal area and the boundary point set, a heat kernel function is performed on the spectral normal area to obtain a multi-scale characteristic spectrum set and a normal reference area; Performing gradient-guided reconstruction based on the multi-scale characteristic spectrum set and the normal reference region to obtain preliminary correction data of the spectral abnormality region; Performing layered guided repair on the preliminary correction data of the spectral abnormality region to obtain corrected spectral information; specifically comprising: layering the preliminary correction data of the spectral abnormality region to obtain a baseline configuration layer, a broad peak structure layer, and a detail feature peak layer; The baseline configuration layer is guided to be repaired using the characteristic spectrum at the first scale to obtain a baseline repair result; based on the baseline repair result, the broad peak structure layer is guided to be repaired using the characteristic spectrum at the second scale to obtain a broad peak repair result; based on the broad peak repair result, the detail feature peak layer is finely repaired using the characteristic spectrum at the third scale to obtain corrected spectral information.
2. The spectral information correction method for spectral abnormality areas according to claim 1, characterized in that: The fiber optic confocal micro-Raman spectroscopy system is used to collect raw spectral data and perform multi-scale gradient analysis to obtain multi-layer gradient flow field characterization data, including: Perform laser scanning excitation on the sample in the fiber confocal micro-Raman spectroscopy system to obtain raw spectral data; Performing discrete gradient calculation on the original spectral data to obtain initial velocity field data; Applying a Gaussian kernel function to perform a convolution operation on the initial velocity field data to obtain multi-scale velocity field data at different scales; Based on the multi-scale velocity field data at different scales, the flow field divergence characteristics at each scale are calculated to obtain flow field characteristic parameters, and the flow field characteristic parameters are organized and arranged at different scales to obtain multi-layer gradient flow field characterization data.
3. The spectral information correction method for spectral abnormality areas according to claim 1, characterized in that: The flow field topology analysis is performed on the multi-layer gradient flow field characterization data to obtain a spectral abnormal area and a set of boundary points, including: Calculating divergence values of velocity fields at various scales in the multi-layer gradient flow field characterization data to obtain divergence data; Anomaly score calculation is performed based on the divergence data to obtain an initial anomaly score value for each wave number point, and multi-scale weighted fusion is performed on the initial anomaly score value to obtain comprehensive anomaly score data; Setting a threshold value according to the comprehensive abnormality score data to determine abnormal points, obtaining an abnormal point set, and connecting adjacent abnormal points in the abnormal point set to obtain a spectral abnormal region; Boundary extraction and analysis are performed on the abnormal spectral region to obtain a set of boundary points including the junction of the normal region and the abnormal region.
4. The spectral information correction method for spectral abnormality areas according to claim 1, characterized in that: The method of performing heat kernel function processing on the normal spectral region based on the abnormal spectral region and the boundary point set to obtain a multi-scale characteristic spectral set and a normal reference region includes: Constructing a k-nearest neighbor graph for the original spectral data in a wavenumber-intensity space to obtain a spectral graph structure representing a connection relationship between spectral points, wherein the spectral graph structure includes a vertex set, an edge set, and a weight matrix; Calculating a graph Laplace matrix according to the spectral graph structure, and performing an eigendecomposition operation on the graph Laplace matrix to obtain a Laplace eigenvector set; Using the Laplace eigenvector set, mapping and transforming the spectral abnormal region and the normal region around it to obtain a low-dimensional manifold representation; Parameterizing the spectral anomaly region based on the low-dimensional manifold representation to obtain a spectral Riemannian manifold space, wherein the spectral anomaly region is represented as a regular parameter region by the spectral Riemannian manifold space; Based on the spectral Riemannian manifold space, a heat kernel function is performed on the normal region of the spectrum to obtain a multi-scale characteristic spectrum set and a normal reference region.
5. The spectral information correction method for spectral abnormality areas according to claim 4, characterized in that: The heat kernel function processing is performed on the normal region of the spectrum based on the spectral Riemannian manifold space to obtain a multi-scale characteristic spectrum set and a normal reference region, including: Introducing a heat kernel function into the spectral Riemannian manifold space, calculating the geodesic distance between a normal spectral point and other points on the spectral Riemannian manifold space, and obtaining distance metric data; Based on the distance metric data, a heat kernel weighted integral operation is performed on the normal spectrum data under different scale parameters to obtain heat kernel characteristic data; Organizing and arranging the thermal nuclear characteristic data at multiple preset scales to obtain a multi-scale characteristic spectrum set containing local details and global structural information; A manifold distance metric comparison is performed from the spectral normal regions to identify a normal reference region corresponding to the set of boundary points.
6. The method for correcting spectral information of spectral abnormality regions according to claim 1, characterized in that: The performing gradient-guided reconstruction according to the multi-scale characteristic spectrum set and the normal reference region to obtain preliminary correction data of the spectral abnormality region includes: Constructing a manifold hole filling and reconstruction objective function for the spectral abnormal area; Performing target gradient field construction based on the multi-scale characteristic spectrum set and the normal reference area to obtain spectral gradient information; The manifold hole filling and reconstruction objective function is processed by the variational principle to obtain a Poisson equation, wherein the Poisson equation uses a set of boundary points of the spectral anomaly region as a boundary condition; The Poisson equation is discretized and solved to obtain preliminary correction data of the spectral abnormal area.
7. The method for correcting spectral information of spectral abnormality regions according to claim 6, characterized in that: The variational principle processing is performed on the manifold hole filling and reconstruction objective function to obtain a Poisson equation, wherein the Poisson equation uses the boundary point set of the spectral abnormal area as a boundary condition, including: Creating a function expression representing the integrated square error between the reconstructed spectral gradient and the target gradient field according to the manifold hole filling and reconstruction objective function; Derivation of the Euler-Lagrange equation for the function expression to obtain a necessary condition for an optimal solution, wherein the necessary condition for the optimal solution is characterized in that the function variation is zero at the minimum point; Based on the manifold curvature characteristics of different regions of the spectral anomaly region, a spatially varying adaptive regularization term is introduced into the function expression to obtain an improved objective function; A variational calculus operation is performed on the improved objective function to obtain a Poisson equation, and the spectral values in the boundary point set of the spectral anomaly region are used as boundary conditions of the Poisson equation.
8. A spectral information correction system for spectral abnormality regions, characterized in that: Used to perform the spectral information correction method of the spectral abnormal region according to any one of claims 1 to 7, the spectral information correction system of the spectral abnormal region comprises: An acquisition module is used to collect raw spectral data through a fiber confocal micro-Raman spectroscopy system and perform multi-scale gradient analysis to obtain multi-layer gradient flow field characterization data; An analysis module, configured to perform flow field topology analysis on the multi-layer gradient flow field characterization data to obtain a spectral abnormality region and a set of boundary points; A processing module is used to perform heat kernel function processing on the normal spectral region based on the abnormal spectral region and the boundary point set to obtain a multi-scale characteristic spectrum set and a normal reference region; a reconstruction module, configured to perform gradient-guided reconstruction based on the multi-scale characteristic spectrum set and the normal reference region to obtain preliminary correction data of the spectral abnormality region; The repair module is used to perform layered guided repair on the preliminary correction data of the spectral anomaly area to obtain corrected spectral information; specifically comprising: layering the preliminary correction data of the spectral anomaly area to obtain a baseline configuration layer, a broad peak structure layer and a detail feature peak layer; applying a characteristic spectrum at a first scale to perform guided repair processing on the baseline configuration layer to obtain a baseline repair result; based on the baseline repair result, applying a characteristic spectrum at a second scale to perform guided repair processing on the broad peak structure layer to obtain a broad peak repair result; based on the broad peak repair result, applying a characteristic spectrum at a third scale to perform fine repair processing on the detail feature peak layer to obtain corrected spectral information.
Citation Information
Patent Citations
Raman spectrum abnormal data detection method and system based on deep learning
CN119939226A
Hyperspectral image anomaly detection method and system based on spectral cubic features and gradient contrast
CN119991575A