A spectrum reconstruction method and system for a spectrometer
By combining deep learning and LSTM models with environmental parameters and vibration characteristic data, the accuracy problem of spectral data collection by spectrometers in complex environments is solved, and high-precision spectral image reconstruction is achieved, which is suitable for spectral analysis in complex environments.
Patent Information
- Application Number
- CN202510174316.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-02-18
AI Technical Summary
When existing spectrometers collect spectral data in complex experimental environments, they are affected by factors such as ambient temperature, humidity, and mechanical vibration, which can cause the center position of the spectral peak to drift, the peak intensity to weaken, or the peak width to increase. Traditional methods are unable to cope with these interference factors in real time, affecting the accuracy and adaptability of the spectrum.
A spectral image reconstruction method based on deep learning is adopted. By acquiring spectral data and environmental parameters, a long short-term memory network model (LSTM) is established. Combined with the ambient temperature, humidity and vibration characteristic data, the spectral peak center position, peak intensity and peak width are corrected to achieve accurate spectral image reconstruction.
It effectively reduces the influence of instrument noise and background interference, restores the characteristic details of the spectrum, and has high-precision spectral analysis capabilities. It is suitable for fields such as material analysis, drug testing and pollution monitoring, providing flexibility and reliable analysis results.
Smart Images

Figure CN119964687B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spectrum reconstruction, and in particular to a spectrum reconstruction method and system for a spectrometer. Background Art
[0002] As an important analytical instrument, the spectrometer is widely used in many fields such as chemistry, physics, biology, and materials science. Its main function is to obtain spectral information of a substance by measuring the absorption, emission, or scattering properties of light. The spectrum is an important basis for analyzing the composition, structure, and state of a substance. However, the spectral data collected by an actual spectrometer is often affected by multiple factors such as environmental conditions, instrument characteristics, and external interference, resulting in a certain deviation between the collected spectral data and the "spectral diagram" of the substance. Especially in complex experimental environments, factors such as ambient temperature, humidity, and mechanical vibration can cause the center position of the spectral peak to drift, the peak intensity to weaken, or the peak width to increase, thereby weakening the spectrometer's ability to adapt to actual analysis scenarios.
[0003] Traditional spectral data processing methods typically rely on hardware improvements or simple mathematical algorithms such as filtering, interpolation, or baseline correction. However, these methods have significant limitations: First, hardware improvements require additional costs and cannot completely eliminate environmental interference; second, simple mathematical methods lack the ability to comprehensively process multidimensional perturbations, making it difficult to accurately recover the detailed features of the spectral image. Furthermore, due to changes in environmental factors (such as temperature and humidity) and the dynamic changes in the spectrometer's operating state (such as vibration characteristics), traditional methods struggle to cope with these complex and changing interference factors in real time.
[0004] In recent years, with the rapid development of artificial intelligence technology, especially the outstanding performance of deep neural networks in nonlinear data processing, new possibilities have been brought to the processing and analysis of spectral data. Deep neural networks can learn the complex mapping relationship between spectral data and spectral graphs by training massive data samples, thereby effectively solving the nonlinear modeling difficulties faced by traditional methods. However, existing spectral correction methods based on neural networks still have shortcomings. Most methods fail to fully consider the impact of the experimental environment and instrument operating status on spectral data, and only rely on static matching between input data and labels, which is inadequate in dynamic and complex actual scenarios. Therefore, how to establish a spectrometer spectrum reconstruction method that can accurately reconstruct spectral graphs based on a deep learning model while integrating environmental parameters and instrument status characteristic data has become an urgent problem to be solved in the current technical field.
[0005] In the prior art, publication number CN114330663A discloses a spectrum reconstruction method for a micro-spectrometer. The specific steps include: first, constructing a spectrum reconstruction network model for the micro-spectrometer; then, training the spectrum reconstruction network; and finally, completing the spectrum reconstruction through the trained spectrum reconstruction network. This solution introduces the idea of image super-resolution without upgrading the hardware system, and adopts a deep learning method to overcome the shortcomings of traditional reconstruction algorithms, significantly improve the reconstruction effect, and achieve spectrum reconstruction with a wavelength range of 2500-5000nm. However, in this solution, the micro-spectrometer may face challenges such as environmental interference (such as temperature, humidity, and vibration) and changes in measurement conditions (such as unstable light source intensity) in actual applications. If these factors are not fully considered during model training, the spectrum reconstruction effect in actual use may be reduced. Therefore, the accuracy and effectiveness of the spectrum reconstruction method are reduced.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention
[0007] The object of the present invention is to provide a spectrum reconstruction method and system for a spectrometer to solve the problems raised in the above background technology.
[0008] To achieve the above object, the present invention provides the following technical solutions:
[0009] A spectrum reconstruction method for a spectrometer, comprising the following steps:
[0010] Obtain reconstructed spectra of several different types of objects, collect spectral data of the objects corresponding to the spectra through a spectrometer in an experimental environment, pre-process the collected spectral data to obtain training spectral data, and compare the training spectral data with the corresponding spectral data. Figure 1 A mapping to generate a training sample set;
[0011] Based on the data in the training sample set, a neural network prediction model is established. The training spectral data in the training sample set is used as the input of the prediction model, and the corresponding spectral graph is used as the label to train the neural network prediction model to obtain a spectral graph reconstruction prediction model;
[0012] The spectral data of the object to be analyzed is collected by a spectrometer, and the environmental parameters of the collection site and the vibration characteristic data of the spectrometer during the collection process are obtained at the same time. The spectral data of the object to be analyzed is pre-processed and then input into the spectrum reconstruction prediction model, and the spectrum reconstruction prediction model outputs a reconstructed spectrum prediction map of the object to be analyzed;
[0013] Based on the obtained environmental parameters of the collection site and the vibration characteristic data of the spectrometer during the collection process, the spectrum characteristic parameters of the reconstructed spectrum prediction map of the object to be analyzed are corrected to obtain accurate values of the spectrum characteristic parameters, wherein the environmental parameters of the collection site include ambient humidity and temperature, the vibration characteristic data include the mean value of the vibration frequency and the vibration amplitude, and the spectrum characteristic parameters include the center position of the spectrum peak, the peak signal intensity, and the line width of the spectrum peak;
[0014] Based on the obtained precise values of the spectrum characteristic parameters, the corresponding parameters in the reconstructed spectrum prediction map of the object to be analyzed are adjusted to obtain a precise reconstructed spectrum map, thus completing the spectrum reconstruction of the spectrometer.
[0015] Furthermore, the collected spectral data is preprocessed to obtain training spectral data, wherein the preprocessing includes baseline correction preprocessing and noise removal preprocessing, wherein a polynomial fitting method is selected for baseline correction, and the specific operation steps include: fitting a polynomial by a least squares method to obtain baseline parameters, and then subtracting the baseline signal from the original spectral data to obtain corrected spectral data;
[0016] The noise removal preprocessing adopts the wavelet transform denoising method, and the specific steps include: using wavelet transform to decompose the original spectral data into different frequency components, and by selecting the appropriate wavelet basis function and decomposition layer number, the signal is represented as low-frequency component and high-frequency component; compressing or removing the noise in the high-frequency component, and using the threshold method to suppress the high-frequency noise while retaining the remaining signal; reconstructing the processed low-frequency component and high-frequency component into the denoised signal;
[0017] The method for generating the training sample set is as follows: the training spectrum data obtained after preprocessing the spectrum data is compared with the spectrum of the object. Figure 1 A mapping is performed to form a corresponding grid, and the formed grid is recorded as a training sample image set.
[0018] Furthermore, based on the data in the training sample set, a neural network prediction model is established, in which the long short-term memory network model LSTM model is selected as the base model, and the activation function and optimization algorithm are selected, in which the Tanh function is selected as the activation function and Adam is selected as the optimization algorithm of the LSTM model; the formula of the Tanh function is:
[0019]
[0020] Where, Represents the Tanh function, independent variable Represents the weighted sum of the neuron's input, that is, the result of weighted summation of the input received by the neuron from the previous layer;
[0021] At the same time, the hyperparameters of the LSTM model are set, including the number of network layers, number of iterations, learning rate, batch size, number of training times, batch size, and number of hidden layer neurons;
[0022] The network layer is set to 4 layers, the number of iterations is set to 300, the learning rate is set to 0.001, the batch size is set to 32, the number of training times is set to 100, the batch size is set to 256, and the number of hidden layer neurons is 32;
[0023] The input of the trained spectrum reconstruction prediction model is the spectral data collected by the spectrometer after preprocessing, and the output is the reconstructed spectrum prediction map.
[0024] Furthermore, the spectral data of the object to be analyzed are preprocessed in the same manner, specifically including baseline correction preprocessing and noise removal preprocessing, and the preprocessed spectral data of the object to be analyzed are input into the spectral image reconstruction prediction model, which outputs a reconstructed spectral prediction image of the object to be analyzed;
[0025] Based on the environmental parameters of the acquisition site and the vibration characteristic data of the spectrometer during the acquisition process, the spectral characteristic parameters of the reconstructed spectrum prediction map of the object to be analyzed are corrected to obtain the accurate values of the spectral characteristic parameters. The specific formula for correcting the center position of the spectral peak is:
[0026]
[0027] Where, is the exact value of the center position of the spectral peak, Reconstruct the center position of the spectral peak in the spectrum prediction graph for the object to be analyzed, is the ambient temperature of the collection site, is the standard temperature in the experimental environment, is the vibration impact index, and are the weight coefficients of temperature and vibration influence index on the correction of the center position of the spectral peak, respectively. and and Both are greater than 0.
[0028] Furthermore, the vibration impact index The specific formula for the calculation is:
[0029]
[0030] Where, is the average value of the spectrometer vibration frequency during the acquisition process, is the spectrometer vibration amplitude, is the initial vibration phase of the spectrometer;
[0031] Among them, based on the vibration impact index The line width of the spectral peak is corrected to obtain the precise value of the spectral peak line width. The specific formula for calculating the precise value of the spectral peak line width is:
[0032]
[0033] Where, is the exact value of the spectral peak line width, Reconstruct the spectrum of the object to be analyzed to predict the spectral peak line width in the graph, is the spectral peak line width correction factor, is the ideal resolution of the spectrometer, is the actual resolution of the spectrometer used.
[0034] Furthermore, the specific formula for correcting the peak signal strength is:
[0035]
[0036] Where, is the exact value of peak signal strength, Reconstruct the peak signal intensity in the spectrum prediction graph for the object to be analyzed, is the humidity correction index, 、 and are the weight coefficients of the influence of ambient temperature, ambient humidity and vibration on peak signal strength, among which and 、 and Both are greater than 0.
[0037] Furthermore, the humidity correction index The specific calculation formula is:
[0038]
[0039] Where, Indicates the ambient humidity of the collection site, is the standard humidity in the experimental environment.
[0040] The present invention further provides a spectrum reconstruction system for a spectrometer, wherein the spectrum reconstruction system for a spectrometer is used to execute the above-mentioned spectrum reconstruction method for a spectrometer, comprising:
[0041] The training sample processing module is used to obtain reconstructed spectra of several different types of objects, collect spectral data of the objects corresponding to the spectra in the experimental environment through the spectrometer, pre-process the collected spectral data to obtain training spectral data, and compare the training spectral data with the corresponding spectral data. Figure 1 A mapping to generate a training sample set;
[0042] A neural network training module is used to establish a neural network prediction model based on the data in the training sample set, use the training spectral data in the training sample set as the input of the prediction model, and use the corresponding spectral graph as a label to train the neural network prediction model to obtain a spectral graph reconstruction prediction model;
[0043] The feature data acquisition module is used to collect spectral data of the object to be analyzed through a spectrometer, and at the same time obtain the environmental parameters of the collection site and the vibration feature data of the spectrometer during the collection process. The spectral data of the object to be analyzed is pre-processed and then input into the spectrum reconstruction prediction model. The spectrum reconstruction prediction model outputs a reconstructed spectrum prediction map of the object to be analyzed;
[0044] a spectrum parameter correction module, configured to correct the spectrum characteristic parameters of the reconstructed spectrum prediction map of the object to be analyzed based on the obtained collection site environmental parameters and the vibration characteristic data of the spectrometer during the collection process, so as to obtain accurate values of the spectrum characteristic parameters, wherein the collection site environmental parameters include ambient humidity and temperature, the vibration characteristic data include the mean vibration frequency and vibration amplitude, and the spectrum characteristic parameters include the center position of the spectrum peak, the peak signal intensity, and the line width of the spectrum peak;
[0045] The precise value adjustment module is used to adjust the corresponding parameters in the reconstructed spectrum prediction map of the object to be analyzed based on the precise values of the spectrum characteristic parameters obtained, obtain the precise reconstructed spectrum map, and complete the spectrum reconstruction of the spectrometer.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] First, the spectral data is denoised and smoothed through a preprocessing step, effectively reducing the impact of instrument noise and background interference on the spectral data. This method can more comprehensively eliminate interference factors and restore the characteristic details of the spectral graph, making it suitable for high-precision spectral analysis. This is particularly true in application scenarios with extremely high precision requirements, such as materials analysis, drug testing, and pollution monitoring. Second, through the training of the neural network model, it can process spectral data from a large number of different types of objects, thus possessing strong generalization and adaptability. The reconstruction of the spectral graph no longer relies on a single physical model, allowing this method to provide accurate spectral reconstruction when faced with unknown objects or uncertain environments, thereby providing greater flexibility and convenience for scientific research and industrial applications. Finally, by obtaining environmental parameters such as humidity and temperature, as well as equipment vibration data from the acquisition environment, this method can respond to changes in the environment and equipment status in real time. After spectral data preprocessing, it can correct errors caused by environmental changes or equipment vibration, significantly reducing measurement errors caused by environmental and equipment influences and providing more reliable analysis results. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 Schematic diagram of the overall method flow of the present invention;
[0049] Figure 2 Schematic diagram of the overall system structure of the present invention. DETAILED DESCRIPTION
[0050] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to specific embodiments.
[0051] It should be noted that, unless otherwise defined, the technical or scientific terms used in the present invention should have the usual meanings understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0052] Example:
[0053] See also Figure 1 , the present invention provides a technical solution:
[0054] A spectrum reconstruction method for a spectrometer, comprising the following steps:
[0055] Step 1: Obtain reconstructed spectra of several different types of objects, collect spectral data of the objects corresponding to the spectra through a spectrometer in an experimental environment, pre-process the collected spectral data to obtain training spectral data, and compare the training spectral data with the corresponding spectral data. Figure 1 A mapping to generate a training sample set.
[0056] The reconstructed spectrogram uses processing techniques, including interpolation reconstruction, Fourier transform, and sparse modeling, to modify, repair, or regenerate the original spectral signal to eliminate noise and interference, enhance characteristic signals, and ultimately generate high-quality spectral data. The reconstructed spectrogram reduces noise and interference, improving the accuracy of spectral features. The reconstruction technology can also improve spectral resolution and isolate more subtle characteristic peaks. The reconstructed spectrogram generates graphical data that is easy to analyze and interpret, facilitating subsequent research and development.
[0057] The collected spectral data are preprocessed to obtain training spectral data, wherein the preprocessing includes baseline correction preprocessing and noise removal preprocessing, wherein a polynomial fitting method is selected for baseline correction, and the specific operation steps include: fitting a polynomial by a least squares method to obtain baseline parameters, and then subtracting the baseline signal from the original spectral data to obtain corrected spectral data;
[0058] Polynomial fitting is a commonly used spectral baseline correction method for removing baseline drift from spectral data. In spectral analysis, due to instrument noise and the physical properties of the sample itself, the baseline of the spectral signal may drift or change nonlinearly, resulting in reduced accuracy in extracting spectral characteristic parameters. Polynomial fitting can effectively fit the baseline and deduct it from the spectral data, restoring the true spectral signal.
[0059] Obtain the raw spectral data that requires baseline correction, including the spectral wavelength and corresponding spectral intensity. Spectral data is typically stored as a two-dimensional array, where each data point consists of a wavelength and an intensity value. Select the order of the fitting polynomial and the base point line. The baseline point is an area of the spectrum that is not strongly affected by the signal's characteristic peaks and typically represents the true position of the baseline. Fit a baseline polynomial to the selected baseline point using the least squares method. Subtract the fitted baseline function from the raw spectral intensity to obtain the corrected spectral data.
[0060] The noise removal preprocessing adopts the wavelet transform denoising method, and the steps include: using wavelet transform to decompose the original spectral data into different frequency components, and by selecting the appropriate wavelet basis function and decomposition layer number, the signal is represented as low-frequency component and high-frequency component; compressing or removing the noise in the high-frequency component, and using the threshold method to suppress the high-frequency noise while retaining the remaining signal; reconstructing the processed low-frequency component and high-frequency component into a denoised signal;
[0061] The specific process is as follows: select the wavelet basis function. Commonly used wavelet basis functions include Daubechies wavelet (dbN), Symlets wavelet (symN) and Coiflets wavelet (coifN). Daubechies wavelet (such as db4 or db6) is generally selected because it is suitable for processing smooth spectral signals;
[0062] Determine the number of decomposition layers. The number of wavelet decomposition layers determines the scale range of signal decomposition. The number of decomposition layers is determined according to the sampling frequency of the spectral signal and the noise frequency, and is generally set to 4 to 6 layers.
[0063] Perform wavelet decomposition on the signal and the input spectral signal to obtain approximate components (low frequency) and detail components (high frequency) of different scales. The high-frequency detail components are processed using the threshold method to remove noise and retain the signal.
[0064] Signal reconstruction: The processed low-frequency components and the denoised high-frequency components are subjected to inverse wavelet transform to obtain the denoised spectral data.
[0065] The method for generating the training sample set is as follows: the training spectrum data obtained after preprocessing the spectrum data is compared with the spectrum of the object. Figure 1 A mapping is performed to form a corresponding grid, and the formed grid is recorded as a training sample image set.
[0066] Step 2: Based on the data in the training sample set, a neural network prediction model is established. The training spectral data in the training sample set is used as the input of the prediction model, and the corresponding spectral graph is used as the label to train the neural network prediction model to obtain the spectral graph reconstruction prediction model.
[0067] Based on the data in the training sample set, a neural network prediction model is established, in which the long short-term memory network model LSTM model is selected as the base model. The activation function and optimization algorithm are selected, in which the Tanh function is selected as the activation function and Adam is selected as the optimization algorithm of the LSTM model; the formula of the Tanh function is:
[0068]
[0069] Where, Represents the Tanh function, independent variable Represents the weighted sum of the neuron's input, that is, the result of weighted summation of the input received by the neuron from the previous layer;
[0070] At the same time, the hyperparameters of the LSTM model are set, including the number of network layers, number of iterations, learning rate, batch size, number of training times, batch size, and number of hidden layer neurons;
[0071] The network layer is set to 4 layers, the number of iterations is set to 300, the learning rate is set to 0.001, the batch size is set to 32, the number of training times is set to 100, the batch size is set to 256, and the number of hidden layer neurons is 32;
[0072] The input of the trained spectrum reconstruction prediction model is the spectral data collected by the spectrometer after preprocessing, and the output is the reconstructed spectrum prediction map.
[0073] Spectral data is typically a continuous distribution that varies with wavelength. The spectral signal intensities at different wavelengths exhibit certain correlations and physical dependencies. For example, the distribution and width of spectral peaks may affect multiple wavelength regions. The LSTM model has the ability to memorize and capture long-term and short-term dependencies in sequential data. Through its unique memory gate structure (input gate, forget gate, and output gate), it can effectively model the correlations between signals in different wavelength bands in spectral data. This enables the LSTM to better understand the variations in spectral data with wavelength, thereby improving the accuracy of spectral reconstruction.
[0074] There is often a complex nonlinear mapping relationship between spectral signals and the properties of an object. The collected spectral data may exhibit complex deviations from the spectral graph due to factors such as light source interference and instrument characteristics. The LSTM model has powerful nonlinear modeling capabilities. Through its multi-layer network structure and activation functions, it can accurately fit the nonlinear mapping relationship between spectral data and spectral graphs. This gives LSTM a significant advantage in reconstructing spectra with complex features.
[0075] The LSTM model can simultaneously process both short-term dependencies (local band features) and long-term dependencies (global features across bands), enabling it to better account for full spectral information within the long-wavelength range. Furthermore, the LSTM memory mechanism can effectively alleviate the problem of gradual signal attenuation or distortion within the long-wavelength range, thereby improving spectral reconstruction.
[0076] Step 3: Collect spectral data of the object to be analyzed through a spectrometer, and at the same time obtain the environmental parameters of the collection site and the vibration characteristic data of the spectrometer during the collection process. The spectral data of the object to be analyzed is preprocessed and input into the spectrum reconstruction prediction model. The spectrum reconstruction prediction model outputs a reconstructed spectrum prediction map of the object to be analyzed.
[0077] The collection location specifically refers to the environment where the spectrometer is located when collecting spectral data of the object to be analyzed.
[0078] Ambient temperature is collected using a temperature sensor such as a digital temperature sensor, thermistor, or infrared temperature sensor. A digital temperature sensor (such as the DS18B20 or BME280) or thermistor module should be installed in the spectrometer sampling environment. The sensor should be placed as close as possible to the spectrometer sampling area to ensure that the measured temperature data reflects the actual temperature of the sampling area. The temperature sensor should be connected to a data acquisition system (such as a microcontroller, embedded computer, or data acquisition card) to read the ambient temperature in real time using a sensor interface (such as I2C, SPI, or analog signal).
[0079] The method for collecting ambient humidity is: use a humidity sensor such as a capacitive humidity sensor or a digital humidity sensor, install a humidity sensor (such as SHT31, DHT22, BME280 and other multi-function environmental sensors) in the spectrometer sampling environment, ensure that the sensor can sense the humidity of the surrounding air in real time, connect the output signal of the humidity sensor to the data acquisition system, and read the humidity data through a digital interface (such as I2C or SPI).
[0080] The method for collecting the mean vibration frequency is: use a vibration sensor such as an accelerometer or vibration pickup, and install the accelerometer or vibration sensor (such as ADXL345, MPU6050) on the mechanical structure of the spectrometer (such as the spectrometer housing or bracket). The mean vibration frequency can be obtained by the following calculation method: perform a fast Fourier transform on the acceleration data collected by the sensor, convert the time domain signal into a frequency domain signal, and extract the mean of the main frequency components from the spectrum as the mean vibration frequency.
[0081] The vibration amplitude can be calculated from the acceleration data measured by the accelerometer. Generally speaking, the amplitude of acceleration is proportional to the amplitude of mechanical vibration.
[0082] Step 4: Based on the obtained environmental parameters of the collection site and the vibration characteristic data of the spectrometer during the collection process, the spectrum characteristic parameters of the reconstructed spectrum prediction map of the object to be analyzed are corrected to obtain the precise values of the spectrum characteristic parameters, wherein the environmental parameters of the collection site include ambient humidity and temperature, the vibration characteristic data include the mean vibration frequency and vibration amplitude, and the spectrum characteristic parameters include the center position of the spectrum peak, the peak signal intensity and the line width of the spectrum peak.
[0083] The spectral data of the object to be analyzed are subjected to the same preprocessing method, specifically including baseline correction preprocessing and noise removal preprocessing, and the preprocessed spectral data of the object to be analyzed are input into the spectral image reconstruction prediction model, and the spectral image reconstruction prediction model outputs a reconstructed spectral prediction image of the object to be analyzed;
[0084] The characteristic parameters in the reconstructed spectrum prediction graph of the object to be analyzed can be quickly detected, fitted, and parameter extracted using spectrum analysis software (such as Origin, MATLAB, and the SciPy library in Python). In particular, in Python, find_peaks (SciPy library) can be used to detect the peak position and fit it with the curve_fit function to obtain the center position, peak intensity, and line width.
[0085] Based on the environmental parameters of the acquisition site and the vibration characteristic data of the spectrometer during the acquisition process, the spectral characteristic parameters of the reconstructed spectrum prediction map of the object to be analyzed are corrected to obtain the accurate values of the spectral characteristic parameters. The specific formula for correcting the center position of the spectral peak is:
[0086]
[0087] Where, is the exact value of the center position of the spectral peak, Reconstruct the center position of the spectral peak in the spectrum prediction graph for the object to be analyzed, is the ambient temperature of the collection site, is the standard temperature in the experimental environment, is the vibration impact index, and are the weight coefficients of temperature and vibration influence index on the correction of the center position of the spectral peak, respectively. and and Both are greater than 0.
[0088] Among them, it should be noted that changes in ambient temperature will cause thermal expansion or refractive index changes in the materials, optical paths, and components (such as gratings and detectors) inside the spectrometer, thereby causing the drift of the spectral peak position. When the ambient temperature is higher than the standard temperature, the spectral peak may drift toward the long-wave direction. When the ambient temperature is lower than the standard temperature, the spectral peak may drift toward the short-wave direction. Therefore, through Determine the drift direction and make corrections. When the ambient temperature is higher than the standard temperature, that is, Greater than 0, the exact value of the center position of the spectrum peak Inversely proportional to the ambient temperature, the center position of the spectrum peak is precisely Correction is made in the short-wave direction to match the true value, and vice versa to make the center position of the spectrum peak accurate. Correction to the long wave direction. Through the logarithmic function This is used to simulate the nonlinear effect of temperature on the spectral peak position. Larger temperature deviations result in more significant corrections.
[0089] Among them, since temperature is usually the main factor of spectral peak drift, it has a more significant impact on the spectrum than vibration. Temperature changes may affect the refractive index of the grating and the stability of the light source wavelength, while vibration may be instantaneous and small vibrations have little effect on drift. Therefore, setting and and Both are greater than 0.
[0090] Vibration Impact Index The larger the value, the greater the disturbance of the optical system (such as grating, lens, reflector) or mechanical structure in the spectrometer. These disturbances may cause the optical path to deviate from the original optical axis, or the relative position between optical components may change, which may cause the spectral peak to drift toward the long-wave direction. , and make corrections to the drift in the opposite direction.
[0091] The vibration impact index The specific formula for the calculation is:
[0092]
[0093] Where, is the average value of the spectrometer vibration frequency during the acquisition process, is the spectrometer vibration amplitude, is the initial vibration phase of the spectrometer.
[0094] The vibration impact index The larger it is, the greater the vibration amplitude and average frequency of the spectrometer, and the greater the impact on the spectrometer operating parameters.
[0095] Vibration amplitude It is a direct reflection of the vibration intensity of the spectrometer. The larger the amplitude, the more significant the optical path deviation or optical element disturbance caused by the vibration. Vibration Impact Index Proportional, Used to reduce the growth rate of large-amplitude vibration to avoid excessive nonlinear effects on the results when the vibration amplitude is too large. Exponential function Used to highlight the impact of vibration amplitude, that is, the increase in vibration amplitude will lead to the vibration impact index Grow exponentially, thus emphasizing the importance of magnitude.
[0096] Mean vibration frequency It is the periodic characteristic of vibration and describes the frequency of vibration. Periodic vibration will interfere with the acquisition period of spectral signal. The initial phase It is the time starting point offset of the vibration, which describes the difference in the starting position of the vibration in the time dimension. Describes the periodic perturbation of the spectrometer by vibration. and phase The combination of simulating the periodic drift effect introduced by mechanical vibration.
[0097] Among them, based on the vibration impact index The line width of the spectral peak is corrected to obtain the precise value of the spectral peak line width. The specific formula for calculating the precise value of the spectral peak line width is:
[0098]
[0099] Where, is the exact value of the spectral peak line width, Reconstruct the spectrum of the object to be analyzed to predict the spectral peak line width in the graph, is the spectral peak line width correction factor, is the ideal resolution of the spectrometer, is the actual resolution of the spectrometer used.
[0100] Spectrometers rely on precise optical path design to focus light from the light source onto the detector. Mechanical vibrations can cause the optical path to shift or defocus, that is, the light beam deviates from the designed optical axis. If the optical path shifts or defocuses, the energy distribution of the spectral peak will expand to a wider range, resulting in a wider line width of the spectral peak. Therefore, in order to make the line width of the spectral peak closer to the true value, the precise value of the spectral peak line width must be calculated. and Inversely proportional.
[0101] It is the ideal resolution of the spectrometer, that is, the minimum spectral line width that the spectrometer can distinguish under ideal conditions (no vibration, no error), and the actual resolution of the spectrometer is It will be affected by mechanical errors, optical component quality and other factors. The actual resolution will be restricted by environmental factors and decrease. Therefore, the actual resolution With ideal resolution The difference between the peak width and the exact value of the spectrum Inversely proportional.
[0102] By the square root of the sum of squares , taking into account the joint influence of resolution and vibration, the two are combined in the form of the square root of the sum of squares, reflecting the synthetic effect of these two factors on the spectral peak linewidth.
[0103] The theoretical resolution of the spectrometer is The actual resolution of the spectrometer can be checked directly from the spectrometer's data sheet. It can be evaluated by measuring the spectral peak linewidth of a known standard spectral source (such as laser, mercury lamp, sodium lamp, etc.).
[0104] Spectral peak linewidth correction factor It can be set based on expert experience, and the general range is between 0.001 and 0.005.
[0105] The specific formula for correcting the peak signal intensity is:
[0106]
[0107] Where, is the exact value of peak signal strength, Reconstruct the peak signal intensity in the spectrum prediction graph for the object to be analyzed, is the humidity correction index, 、 and are the weight coefficients of the influence of ambient temperature, ambient humidity and vibration on peak signal strength, among which and 、 and Both are greater than 0.
[0108] The humidity correction index The specific calculation formula is:
[0109]
[0110] Where, Indicates the ambient humidity of the collection site, is the standard humidity in the experimental environment.
[0111] Temperature changes the refractive index of lens and window materials, thereby changing the light propagation path and alignment of the optical system. This change in refractive index may cause the transmission efficiency of the spectrometer to decrease, resulting in a decrease in signal intensity. The detector of the spectrometer (such as CCD or InGaAs array) is very sensitive to temperature. The increase in temperature will increase the dark current and noise level of the detector. The increase in noise will reduce the signal-to-noise ratio of the signal, thereby reducing the peak intensity of the spectrum. Therefore, the exact value of the peak signal intensity is not suitable for the actual value of the peak signal intensity. Proportional to the ambient temperature, this is used to correct the decrease in spectral peak intensity to make it more consistent with the actual situation. Used to indicate that temperature has a greater effect on peak signal intensity when the difference is large enough.
[0112] The impact of humidity changes is mainly reflected in the hygroscopic effect of optical components, changes in environmental absorption characteristics, and changes in sample characteristics. In a high humidity environment, optical components (such as lenses and windows) may absorb moisture, resulting in the formation of a water film on the surface. This will reduce the transmittance or reflection efficiency of light, thereby reducing signal intensity. Water molecules in the environment have strong absorption characteristics for light, especially at certain specific wavelengths (such as the infrared region). When humidity rises, the absorption of water vapor increases, which may directly weaken the intensity of the peak signal. Therefore, the precise value of the peak signal intensity is difficult to determine. Directly proportional to the ambient humidity.
[0113] Mechanical vibration can cause slight displacement of optical components, resulting in optical path deviation. Optical path deviation may cause the light beam to fail to fully focus on the detector, and the energy loss of light will cause the signal intensity to decrease. At the same time, vibration can cause the focal position of the optical system to deviate from the design value, thereby reducing the intensity of the spectral signal. Therefore, the peak signal intensity is accurate. and Proportional, through the logarithmic function Said that with As the value of α increases, the impact on the peak signal strength gradually decreases.
[0114] Humidity Correction Index Used to characterize the difference between the actual ambient humidity and the standard humidity in the experimental environment, expressed by an exponential function The greater the humidity difference, the greater the impact on peak signal strength.
[0115] The standard humidity in the experimental environment Generally take to The standard temperature in the experimental environment Generally take .
[0116] Since the influence of humidity on spectral measurement is more direct and significant, water vapor in the environment has strong optical absorption characteristics. As the humidity increases, the absorption of water vapor increases, which directly weakens the spectral signal intensity. High humidity may cause water film to form on the surface of optical components or adsorb moisture, reducing the optical transmission efficiency, which will introduce uniform signal intensity attenuation in the entire spectral range. Therefore, the influence of humidity on signal intensity is systematic and significant, and is usually more difficult to eliminate than the influence of temperature or vibration. Vibration mainly indirectly changes the spectral peak signal intensity by affecting the stability of the optical system. Compared with temperature and humidity, the overall impact of vibration on the spectral peak signal intensity is smaller in magnitude and range, so setting and 、 and Both are greater than 0.
[0117] Step 5: Based on the obtained precise values of the spectrum characteristic parameters, the corresponding parameters in the reconstructed spectrum prediction map of the object to be analyzed are adjusted to obtain the precise reconstructed spectrum map, thus completing the spectrum reconstruction of the spectrometer.
[0118] See also Figure 2 The present invention further provides a spectrum reconstruction system for a spectrometer, wherein the spectrum reconstruction system for a spectrometer is used to execute the above-mentioned spectrum reconstruction method for a spectrometer, comprising:
[0119] The training sample processing module is used to obtain reconstructed spectra of several different types of objects, collect spectral data of the objects corresponding to the spectra in the experimental environment through the spectrometer, pre-process the collected spectral data to obtain training spectral data, and compare the training spectral data with the corresponding spectral data. Figure 1 A mapping to generate a training sample set;
[0120] A neural network training module is used to establish a neural network prediction model based on the data in the training sample set, use the training spectral data in the training sample set as the input of the prediction model, and use the corresponding spectral graph as a label to train the neural network prediction model to obtain a spectral graph reconstruction prediction model;
[0121] The feature data acquisition module is used to collect spectral data of the object to be analyzed through a spectrometer, and at the same time obtain the environmental parameters of the collection site and the vibration feature data of the spectrometer during the collection process. The spectral data of the object to be analyzed is pre-processed and then input into the spectrum reconstruction prediction model. The spectrum reconstruction prediction model outputs a reconstructed spectrum prediction map of the object to be analyzed;
[0122] a spectrum parameter correction module, configured to correct the spectrum characteristic parameters of the reconstructed spectrum prediction map of the object to be analyzed based on the obtained collection site environmental parameters and the vibration characteristic data of the spectrometer during the collection process, so as to obtain accurate values of the spectrum characteristic parameters, wherein the collection site environmental parameters include ambient humidity and temperature, the vibration characteristic data include the mean vibration frequency and vibration amplitude, and the spectrum characteristic parameters include the center position of the spectrum peak, the peak signal intensity, and the line width of the spectrum peak;
[0123] The precise value adjustment module is used to adjust the corresponding parameters in the reconstructed spectrum prediction map of the object to be analyzed based on the precise values of the spectrum characteristic parameters obtained, obtain the precise reconstructed spectrum map, and complete the spectrum reconstruction of the spectrometer.
[0124] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0125] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraints of the technical solution.
[0126] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment as needed.
[0127] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A spectrum reconstruction method for a spectrometer, characterized in that: The specific steps include: Obtain reconstructed spectra of several different types of objects, collect spectral data of the objects corresponding to the spectra using a spectrometer in an experimental environment, preprocess the collected spectral data to obtain training spectral data, and map the training spectral data to the corresponding spectra one-to-one to generate a training sample set; Based on the data in the training sample set, a neural network prediction model is established. The training spectral data in the training sample set is used as the input of the prediction model, and the corresponding spectral graph is used as the label to train the neural network prediction model to obtain a spectral graph reconstruction prediction model; The spectral data of the object to be analyzed is collected by a spectrometer, and the environmental parameters of the collection site and the vibration characteristic data of the spectrometer during the collection process are obtained at the same time. The spectral data of the object to be analyzed is pre-processed and then input into the spectrum reconstruction prediction model, and the spectrum reconstruction prediction model outputs a reconstructed spectrum prediction map of the object to be analyzed; Based on the obtained environmental parameters of the collection site and the vibration characteristic data of the spectrometer during the collection process, the spectrum characteristic parameters of the reconstructed spectrum prediction map of the object to be analyzed are corrected to obtain accurate values of the spectrum characteristic parameters, wherein the environmental parameters of the collection site include ambient humidity and temperature, the vibration characteristic data include the mean value of the vibration frequency and the vibration amplitude, and the spectrum characteristic parameters include the center position of the spectrum peak, the peak signal intensity, and the line width of the spectrum peak; Based on the obtained precise values of the spectrum characteristic parameters, the corresponding parameters in the reconstructed spectrum prediction map of the object to be analyzed are adjusted to obtain a precise reconstructed spectrum map, thus completing the spectrum reconstruction of the spectrometer.
2. The spectrum reconstruction method of a spectrometer according to claim 1, characterized in that: The collected spectral data are preprocessed to obtain training spectral data, wherein the preprocessing includes baseline correction preprocessing and noise removal preprocessing, wherein a polynomial fitting method is selected for baseline correction, and the specific operation steps include: fitting a polynomial by a least squares method to obtain baseline parameters, and then subtracting the baseline signal from the original spectral data to obtain corrected spectral data; The noise removal preprocessing adopts the wavelet transform denoising method, and the specific steps include: using wavelet transform to decompose the original spectral data into different frequency components, and by selecting the appropriate wavelet basis function and decomposition layer number, the signal is represented as low-frequency component and high-frequency component; compressing or removing the noise in the high-frequency component, and using the threshold method to suppress the high-frequency noise while retaining the remaining signal; reconstructing the processed low-frequency component and high-frequency component into the denoised signal; The training sample set is generated by mapping the training spectral data obtained after preprocessing the spectral data to the spectral image of the object one by one to form a corresponding grid, and recording the formed grid as the training sample image set.
3. The spectrum reconstruction method of a spectrometer according to claim 2, characterized in that: Based on the data in the training sample set, a neural network prediction model is established, in which the long short-term memory network model LSTM model is selected as the base model. The activation function and optimization algorithm are selected, in which the Tanh function is selected as the activation function and Adam is selected as the optimization algorithm of the LSTM model; the formula of the Tanh function is: ; Where, Represents the Tanh function, independent variable Represents the weighted sum of the neuron's input, that is, the result of weighted summation of the input received by the neuron from the previous layer; At the same time, the hyperparameters of the LSTM model are set, including the number of network layers, number of iterations, learning rate, batch size, number of training times, batch size, and number of hidden layer neurons; The network layer is set to 4 layers, the number of iterations is set to 300, the learning rate is set to 0.001, the batch size is set to 32, the number of training times is set to 100, the batch size is set to 256, and the number of hidden layer neurons is 32; The input of the trained spectrum reconstruction prediction model is the spectral data collected by the spectrometer after preprocessing, and the output is the reconstructed spectrum prediction map.
4. The spectrum reconstruction method of a spectrometer according to claim 1, characterized in that: The spectral data of the object to be analyzed are subjected to the same preprocessing method, specifically including baseline correction preprocessing and noise removal preprocessing, and the preprocessed spectral data of the object to be analyzed are input into the spectral image reconstruction prediction model, and the spectral image reconstruction prediction model outputs a reconstructed spectral prediction image of the object to be analyzed; Based on the environmental parameters of the acquisition site and the vibration characteristic data of the spectrometer during the acquisition process, the spectral characteristic parameters of the reconstructed spectrum prediction map of the object to be analyzed are corrected to obtain the accurate values of the spectral characteristic parameters. The specific formula for correcting the center position of the spectral peak is: ; Where, is the exact value of the center position of the spectral peak, Reconstruct the center position of the spectral peak in the spectrum prediction graph for the object to be analyzed, is the ambient temperature of the collection site, is the standard temperature in the experimental environment, is the vibration impact index, and are the weight coefficients of temperature and vibration influence index on the correction of the center position of the spectral peak, respectively. and and Both are greater than 0.
5. The spectrum reconstruction method of a spectrometer according to claim 4, characterized in that: The vibration impact index The specific formula for the calculation is: ; Where, is the average value of the spectrometer vibration frequency during the acquisition process, is the spectrometer vibration amplitude, is the initial vibration phase of the spectrometer; Among them, based on the vibration impact index The line width of the spectral peak is corrected to obtain the precise value of the spectral peak line width. The specific formula for calculating the precise value of the spectral peak line width is: ; Where, is the exact value of the spectral peak line width, Reconstruct the spectrum of the object to be analyzed to predict the spectral peak line width in the graph, is the spectral peak line width correction factor, is the ideal resolution of the spectrometer, is the actual resolution of the spectrometer used.
6. The spectrum reconstruction method of a spectrometer according to claim 4, characterized in that: The specific formula for correcting the peak signal intensity is: ; Where, is the exact value of peak signal strength, Reconstruct the peak signal intensity in the spectrum prediction graph for the object to be analyzed, is the humidity correction index, 、 and are the weight coefficients of the influence of ambient temperature, ambient humidity and vibration on peak signal strength, among which and 、 and Both are greater than 0.
7. The spectrum reconstruction method of a spectrometer according to claim 6, characterized in that: The humidity correction index The specific calculation formula is: ; Where, Indicates the ambient humidity of the collection site, is the standard humidity in the experimental environment.
8. A spectrum reconstruction system for a spectrometer, characterized by: The spectrum reconstruction system of a spectrometer is used to execute the spectrum reconstruction method of a spectrometer according to any one of claims 1 to 7, comprising: The training sample processing module is used to obtain reconstructed spectra of several different types of objects, collect spectral data of the objects corresponding to the spectra using a spectrometer in an experimental environment, pre-process the collected spectral data to obtain training spectral data, and map the training spectral data to the corresponding spectra one-to-one to generate a training sample set; A neural network training module is used to establish a neural network prediction model based on the data in the training sample set, use the training spectral data in the training sample set as the input of the prediction model, and use the corresponding spectral graph as a label to train the neural network prediction model to obtain a spectral graph reconstruction prediction model; The feature data acquisition module is used to collect spectral data of the object to be analyzed through a spectrometer, and at the same time obtain the environmental parameters of the collection site and the vibration feature data of the spectrometer during the collection process. The spectral data of the object to be analyzed is pre-processed and then input into the spectrum reconstruction prediction model. The spectrum reconstruction prediction model outputs a reconstructed spectrum prediction map of the object to be analyzed; a spectrum parameter correction module, configured to correct the spectrum characteristic parameters of the reconstructed spectrum prediction map of the object to be analyzed based on the obtained collection site environmental parameters and the vibration characteristic data of the spectrometer during the collection process, so as to obtain accurate values of the spectrum characteristic parameters, wherein the collection site environmental parameters include ambient humidity and temperature, the vibration characteristic data include the mean vibration frequency and vibration amplitude, and the spectrum characteristic parameters include the center position of the spectrum peak, the peak signal intensity, and the line width of the spectrum peak; The precise value adjustment module is used to adjust the corresponding parameters in the reconstructed spectrum prediction map of the object to be analyzed based on the precise values of the spectrum characteristic parameters obtained, obtain the precise reconstructed spectrum map, and complete the spectrum reconstruction of the spectrometer.
Citation Information
Patent Citations
Spectrogram reconstruction method for micro spectrometer
CN114330663A
Spectrometer spectrum reconstruction method based on physical guidance neural network
CN117058028A
Nuclear magnetic resonance spectrum noise reduction method and nuclear magnetic resonance spectrum noise reduction device thereof
CN117314765A