A Spectral Reconstruction Method for Spectrometers Based on Physically Guided Neural Networks
By combining the spectrometer measurement model with a deep neural network and optimizing parameters to establish a spectral reconstruction mapping, the problem of low spectral reconstruction accuracy is solved, and efficient and accurate spectral reconstruction is achieved.
Patent Information
- Application Number
- CN202311005104.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-08-10
AI Technical Summary
Existing spectrometer spectral reconstruction methods are prone to getting trapped in local optima and overfitting, resulting in low reconstruction accuracy. Furthermore, traditional deep learning methods require a large amount of data and a stable environment, making it difficult to achieve efficient and accurate spectral reconstruction.
By combining the measurement model of the spectrometer with a deep neural network, a physical-guided neural network is constructed. The network parameters are optimized using the mean square error function and the loss function of the total variation regularization term, combined with the gradient descent method, to establish a mapping relationship from the measured spectrum to the reconstructed spectrum.
It improves the accuracy of spectral reconstruction, suppresses the influence of noise, saves data acquisition time, avoids the influence of instrument and environmental instability, and enhances the reconstruction effect.
Smart Images

Figure CN117058028B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a spectrometer spectral reconstruction method based on a physical guided neural network, belonging to the field of optoelectronic measurement technology. Background Technology
[0002] A spectrometer, by detecting and analyzing the spectrum of incident light, can measure the components and properties of target substances, and is a fundamental optical detection instrument. With the continuous development of optoelectronics, computers, lasers, and advanced manufacturing technologies, the performance of spectrometers has been continuously improved, and their application fields have been widely expanded. Currently, spectrometers are widely used in food safety, biochemical analysis, industrial automatic monitoring, deep space exploration, and other fields. However, due to the influence of spectrometer instrument functions and noise, the measured spectrum often suffers spectral distortion, thus affecting spectral resolution and leading to certain spectral measurement errors. To obtain more accurate measurement results, using spectral reconstruction algorithms to reconstruct the measured spectrum is an effective method.
[0003] Spectral reconstruction algorithms are a classic class of methods for solving inverse problems, estimating the true spectrum from known measured spectra and instrument functions. Most existing spectral reconstruction methods are based on physical models of the measured spectra, solving them through mathematical transformations, such as the Richardson-Lucy (RL) method, or by constructing a loss function that incorporates both the measured and true spectra, such as the Levenberg-Marquardt (LM) method. However, these methods are prone to getting trapped in local optima and overfitting, leading to significant differences between the reconstructed and true spectra, resulting in low reconstruction accuracy. In recent years, deep learning techniques have also been used to address spectral reconstruction problems. These methods train neural networks using datasets from model building or spectrometer acquisition, constructing a mapping from measured to true spectra. However, this approach often requires a large amount of data to train the network to achieve good reconstruction accuracy and generalization ability. However, acquiring large amounts of data is time-consuming and highly dependent on the stability of the environment and the instrument itself, making it difficult to implement. Furthermore, because it ignores known prior physical information, the reconstruction accuracy of this method is not ideal. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of the prior art by providing a spectrometer spectral reconstruction method based on a physical guided neural network, in order to improve the reconstruction effect and robustness of existing spectrometer spectral reconstruction algorithms, thereby improving the reconstruction accuracy of the measured spectrum.
[0005] The present invention adopts the following technical solution to solve the technical problem:
[0006] The present invention discloses a spectrometer spectral reconstruction method based on a physical guided neural network, characterized by comprising the following steps:
[0007] Step 1: Collect the output light of the line spectrum light source using a spectrometer, and after obtaining the line spectrum, perform area normalization processing to obtain the instrument function b corresponding to the spectrometer, thereby obtaining the spectrometer measurement model H;
[0008] Step 2, construct a deep neural network R θ and initialize R θ The network parameters θ included are used to construct R. θ The loss function L is the weighted sum of the mean square error function MSELoss and the total variation regularization term TV;
[0009] Step 3: Obtain the measured spectrum M from the spectrometer and input it into the deep neural network R. θ The measured spectrum M is processed to output the estimated reconstructed spectrum R. θ (M); estimate the reconstructed spectrum R θ (M) is substituted into the spectrometer measurement model H, and the estimated measurement spectrum H(R) is obtained. θ (M)); The estimated measurement spectrum H(R) is calculated using the loss function L. θ The loss value between (M) and the actual measured spectrum M is used to iteratively update the network parameters θ using the gradient descent method until the iteration stopping condition is met, thereby obtaining the optimized network parameters θ. * ;
[0010] Step 4, optimize the network parameters θ * Substitute into deep neural network R θ In this process, the physically guided neural network R is obtained. θ* It is used to establish the mapping relationship between the measured spectrum and the reconstructed spectrum in order to reconstruct the measured spectrum.
[0011] The spectrometer spectral reconstruction method based on a physical guided neural network described in this invention is also characterized in that the spectrometer measurement model H in step 1 is as shown in equation (1):
[0012]
[0013] In equation (1), λ is the wavelength, S is the true spectrum of the target, and N represents the measurement noise.
[0014] The loss function L in step 2 is shown in equation (2):
[0015]
[0016] In equation (2), α is the regularization parameter.
[0017] The iteration stopping condition in step 3 is reaching the maximum number of iterations or satisfying ||θ n+1 -θ n || / ||θ n ||>T, where θ n Let θ represent the network parameters in the nth iteration. n+1 Let T represent the network parameters for the (n+1)th iteration, and T represent the threshold.
[0018] The present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the spectrometer spectral reconstruction method, and the processor is configured to execute the program stored in the memory.
[0019] The present invention discloses a computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, performs the steps of the spectrometer spectral reconstruction method.
[0020] Compared with existing technologies, the beneficial effects of this invention are reflected in:
[0021] 1. This invention combines the measurement model of a spectrometer with a deep neural network, utilizes the interaction between the model and the neural network, and obtains the network parameters iteratively through the gradient descent method. This avoids the process of collecting training data, saves a lot of time required for data collection, and also avoids the impact of the instability of the instrument and environment during data collection on the reconstruction results.
[0022] 2. In the spectral reconstruction method of this invention, the spectrometer measurement model participates in the optimization process of neural network parameters, providing physical constraints for the output of the neural network. Compared with traditional deep learning-based spectral reconstruction techniques, this method improves the reconstruction of high-frequency details in the reconstructed spectrum, enhances noise suppression, and improves overall reconstruction accuracy. Attached Figure Description
[0023] Figure 1 This is a flowchart of the spectrometer spectral reconstruction method based on a physical guided neural network according to the present invention;
[0024] Figure 2 This is a structural diagram of the neural network used in this embodiment.
[0025] Figure 3 These are the simulated measured spectra, the actual spectra, and the spectral reconstruction results obtained by different methods. Detailed Implementation
[0026] In this embodiment, as Figure 1 As shown, a spectrometer spectral reconstruction method based on a physical guided neural network includes the following steps:
[0027] Step 1: Collect the output light of the line spectrum light source through the spectrometer, and after obtaining the line spectrum, perform area normalization processing to obtain the instrument function b corresponding to the spectrometer, and then use Equation (1) to obtain the spectrometer measurement model H.
[0028]
[0029] In equation (1), λ is the wavelength, S is the true spectrum of the target, and N represents the measurement noise.
[0030] Step 2: Construct a deep neural network R using the CNN architecture framework. θ Its structure is as follows Figure 2 As shown, this untrained neural network consists of four main modules: an input layer, convolutional layers, fully connected layers, and an output layer. The convolutional layers are used for feature extraction, representing the nonlinear mapping between the input data and the true spectrum, while the fully connected layers are used for spectral reconstruction. Each convolutional layer has a set of one-dimensional learnable kernels with a specific window size. After each convolutional layer, ReLU is used as the activation function, followed by subsampling and max pooling. The output of the final convolutional layer is flattened and then fed into the subsequent three fully connected layers. The first two fully connected layers introduce ReLU and random deactivation to reduce overfitting, and the output of the last fully connected layer is fed into a linear activation function.
[0031] Initialize R θ The network parameters θ included are used to construct R. θ The loss function L is the weighted sum of the mean square error function MSELoss and the total variation regularization term TV, as shown in equation (2):
[0032]
[0033] In equation (2), α is the regularization parameter.
[0034] Step 3: Obtain the measured spectrum M of the spectrometer from equation (1) and input it into the deep neural network R. θ The measured spectrum M is processed to output the estimated reconstructed spectrum R. θ (M); estimate the reconstructed spectrum R θ (M) is substituted into the spectrometer measurement model H, and the estimated measurement spectrum H(R) is obtained. θ (M)); The estimated measurement spectrum H(R) is calculated using the loss function L. θ The loss value between (M) and the actual measured spectrum M is used to iteratively update the network parameters θ using the gradient descent method until the iteration stopping condition is met, thereby obtaining the optimized network parameters θ. *The iteration stopping condition is reaching the maximum number of iterations or satisfying ||θ. n+1 -θ n || / ||θ n ||>T, where θ n Let θ represent the network parameters in the nth iteration. n+1 Let represent the network parameters for the (n+1)th iteration, and T represent the threshold. In this example, the regularization parameter α is set to 0.001, the learning rate is 0.001, the threshold is 0.0001, and the maximum number of iterations is 300.
[0035] Step 4, optimize the network parameters θ * Substitute into deep neural network R θ In this process, a physically guided neural network is obtained. Used to establish a mapping relationship between the measured spectrum and the reconstructed spectrum, so as to realize the reconstruction of the measured spectrum.
[0036] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.
[0037] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.
[0038] This invention was implemented using Python 3.8.5 within the PyTorch 1.9.0 framework, employing the Adam optimizer with a learning rate set to 0.01. All computations were performed on a computer equipped with an 11th-generation Intel(R) Core(TM) i7-11800h, 64GB of RAM, and an NVIDIA GeForce RTX 4090 graphics processing unit (GPU).
[0039] This invention compares the spectral reconstruction results obtained by different algorithms, including the Richardson-Lucy method (RL), the Levenberg-Marquardt method (LM), and the method proposed in this invention. The simulation results are as follows: Figure 3 As shown. From Figure 3 The results show that both RL and LM can achieve good reconstruction results, but the results obtained by the method of this invention are closer to the real spectrum of the simulation. It not only suppresses most of the measurement noise, but also contains more detailed information.
Claims
1. A spectrometer spectral reconstruction method based on a physical-guided neural network, characterized in that, Includes the following steps: Step 1: Collect the output light of the line spectrum light source using a spectrometer, and after obtaining the line spectrum, perform area normalization processing to obtain the instrument function b corresponding to the spectrometer, thereby obtaining the spectrometer measurement model H; Step 2, construct a deep neural network R θ and initialize R θ The network parameters θ included are used to construct R. θ The loss function L is the weighted sum of the mean square error function MSELoss and the total variation regularization term TV; Step 3: Obtain the measured spectrum M from the spectrometer and input it into the deep neural network R. θ The measured spectrum M is processed to output the estimated reconstructed spectrum R. θ (M); estimate the reconstructed spectrum R θ (M) is substituted into the spectrometer measurement model H, and the estimated measurement spectrum H(R) is obtained. θ (M)); The estimated measurement spectrum H(R) is calculated using the loss function L. θ The loss value between (M) and the actual measured spectrum M is used to iteratively update the network parameters θ using the gradient descent method until the iteration stopping condition is met, thereby obtaining the optimized network parameters θ. * ; Step 4, optimize the network parameters θ * Substitute into deep neural network R θ In this process, the physically guided neural network R is obtained. θ* It is used to establish the mapping relationship between the measured spectrum and the reconstructed spectrum in order to reconstruct the measured spectrum.
2. The spectrometer spectral reconstruction method based on a physical-guided neural network according to claim 1, characterized in that, The spectrometer measurement model H in step 1 is shown in equation (1): In equation (1), λ is the wavelength, S is the true spectrum of the target, and N represents the measurement noise.
3. The spectrometer spectral reconstruction method based on a physical-guided neural network according to claim 1, characterized in that, The loss function L in step 2 is shown in equation (2): In equation (2), α is the regularization parameter.
4. The spectrometer spectral reconstruction method based on a physical-guided neural network according to claim 1, characterized in that, The iteration stopping condition in step 3 is reaching the maximum number of iterations or satisfying ||θ n+1 -θ n || / ||||θ n ||>T, where θ n Let θ represent the network parameters in the nth iteration. n+1 Let T represent the network parameters for the (n+1)th iteration, and T represent the threshold.
5. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store programs that support the processor in executing any of the spectrometer spectral reconstruction methods of claims 1-4, and the processor is configured to execute the programs stored in the memory.
6. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is run by the processor, it performs the steps of the spectrometer spectral reconstruction method according to any one of claims 1-4.
Citation Information
Patent Citations
Spectral calculation imaging method and device combining depth prior and learnable imaging model
CN115795221A
Spectrum reconstruction method based on meta learning
CN115880155A