A method for establishing a wavelength temperature drift correction model of a spectrometer, a correction method and a correction system
Patent Information
- Application Number
- CN202610695071.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-20
- Publication Date
- 2026-08-18
AI Technical Summary
其实施过程中涉及大规模矩阵求逆或迭代优化求解,计算复杂度高,在1024像素×512波长点的典型配置下,单次重建需执行约5×108次浮点运算,对数据归母和算力资源依赖程度较高
[0020]The wavelength temperature drift correction model establishment method, correction method, and correction system for spectrometers provided by this invention, compared with existing technologies, introduce a two-dimensional polynomial model by using pixel position and operating temperature as joint independent variables to characterize the nonlinear characteristics of the mapping relationship between pixel position and wavelength as a function of temperature. Furthermore, it accurately describes the coupling relationship between the two through a modeling method including cross terms, enabling the established wavelength mapping model to possess high correction accuracy and good robustness over a wide temperature range, effectively improving the wavelength stability and consistency of the spectrometer under multiple temperature conditions. Addressing the problem that existing machine learning methods heavily rely on large-scale training samples and complex computational resources, this invention employs a physically meaningful two-dimensional polynomial modeling and ridge regression parameter constraint method. This requires only a limited number of reasonably distributed calibration spectral line data to complete the model construction, significantly reducing the dependence on data size while ensuring correction accuracy, and enabling rapid establishment and online application of the temperature drift correction model. In particular, the established mapping model from pixel position and temperature to wavelength is represented by a finite number of regression coefficients. The relevant model parameters can be directly written into the spectrometer's storage device and recalled during instrument operation based on the real-time operating temperature, without the need for additional temperature compensation hardware or complex control modules, significantly reducing system hardware costs. Simultaneously, when the working environment or device state changes, the temperature drift correction model can be rapidly reconstructed by recalibrating and updating the model coefficients, demonstrating good engineering feasibility and flexibility. Based on two-dimensional joint modeling of pixel position and temperature, this invention introduces an intermediate-state non-uniform wavelength axis representation and maps the corrected spectral data to a unified standard wavelength axis through wavelength domain interpolation reconstruction, effectively eliminating systematic resampling errors caused by temperature drift and improving wavelength consistency and quantitative analysis reliability in complex multi-spectral-line scenarios.
Smart Images

Figure CN122591052A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spectrometer temperature drift calibration technology, and in particular to a method for establishing a spectrometer wavelength temperature drift correction model, a correction method, and a correction system. Background Technology
[0002] As a precision optical analytical instrument, the spectrometer achieves component identification and quantitative analysis by detecting spectral signals, and has a wide range of applications. Wavelength temperature drift refers to the shift in the mapping relationship between pixel position and actual wavelength during the operation of the spectrometer due to changes in ambient temperature or internal instrument temperature. This results in changes in the measured wavelength corresponding to the same physical spectral line under different time or temperature conditions, manifesting as a global or local shift of the spectral wavelength axis. This directly affects the accuracy of the spectral line center position and reduces the reliability of qualitative and quantitative spectral identification and analysis results.
[0003] To mitigate wavelength drift, current mainstream calibration methods can be broadly categorized into two types: hardware-based physical compensation methods and data-driven algorithmic calibration methods. Hardware-based physical compensation methods minimize drift effects by monitoring temperature in real time and adjusting instrument components, improving instrument stability and anti-interference capabilities under fluctuating temperature environments, but at a higher cost. In industrial applications, data-driven algorithmic calibration has become the mainstream due to its lower cost. This method focuses on post-processing, using mathematical models or machine learning to predict and correct deviations without requiring hardware modifications, offering high flexibility. However, its measurement accuracy heavily relies on high-quality training samples and computational resources.
[0004] Chinese patent document CN120800565A discloses a method for wavelength calibration of a spectrometer. This method acquires spectral data generated by the spectrometer at different temperatures, determines the pixel position offset of the characteristic wavelength point at different temperatures based on the pixel position of the characteristic wavelength point at different temperatures and the pixel position of the characteristic wavelength point at a preset reference temperature, and calibrates the wavelength of the spectrometer based on the pixel position offset of the characteristic wavelength point at different temperatures. Essentially, this method is a segmented correction method based on offset lookup tables, achieving wavelength correction by establishing a correspondence between "temperature and characteristic point offset." This method not only requires characteristic peak extraction and offset calculation for the full-band spectrum at each temperature point—approximately 10^6 floating-point operations per calibration cycle in a typical configuration of 1024 pixels × 512 wavelength points, resulting in high computational resource requirements—but also employs a discrete point offset interpolation correction method, which can only perform linear interpolation between calibrated temperature points, leading to high model complexity and limited generalization ability.
[0005] Chinese patent document CN121230870A discloses a method for calibrating crop spectrometers based on dynamic temperature drift compensation. This method includes acquiring the actual wavelength drift deviation value and the corresponding predicted wavelength drift deviation value for each temperature measurement point and each characteristic spectral line; calibrating the crop spectrometer based on these deviations and obtaining the corrected wavelength; capturing the nonlinear relationship between temperature and wavelength drift by collecting raw data from different temperature points and different characteristic spectral lines, and extending the wavelength drift to the entire wavelength band, thereby achieving wavelength drift compensation across the entire temperature range. Its implementation involves large-scale matrix inversion or iterative optimization, resulting in high computational complexity. In a typical configuration of 1024 pixels × 512 wavelength points, a single reconstruction requires approximately 5 × 10^64 operations. 8 Floating-point operations are highly dependent on data propagation and computing resources. Summary of the Invention
[0006] The purpose of this invention is to provide a method for establishing a wavelength temperature drift correction model for a spectrometer, a correction method, and a correction system, which significantly reduces the dependence on data scale and computing resources while ensuring correction accuracy, and realizes the rapid establishment and online application of the temperature drift correction model.
[0007] To solve the above-mentioned technical problems, the embodiments of the present invention provide a technical solution as follows: A method for establishing a wavelength temperature drift correction model for a spectrometer, comprising the following steps: S1: Under different stable temperature conditions of the spectrometer, spectral data of reference spectral lines are collected using a standard light source or standard substance with known characteristic wavelengths, and the positions of each pixel of the detector and the corresponding operating temperatures are recorded simultaneously to obtain calibration data containing pixel positions, temperatures, and reference wavelengths; S2: A sample dataset is constructed based on the calibration data, wherein pixel positions and temperatures are used as input variables, and the corresponding reference wavelengths are used as output variables; S3: A model is constructed using the pixel position p and the temperature T as input variables. A two-dimensional polynomial feature space is established, wherein the two-dimensional polynomial includes at least a constant term, a first-order term of p, a first-order term of T, a second-order term of p, a second-order term of T, and a cross term between p and T; the input variables and output wavelength data of the two-dimensional polynomial are normalized or standardized; S4: Based on the two-dimensional polynomial feature space, a mapping model from pixel position and temperature to wavelength is established using the ridge regression method. The objective function of this mapping model includes a fitting error term and a regularization term, wherein the regularization term is the product of the L2 norm of the model parameters and the regularization coefficient; by minimizing the objective function, the model parameters are solved to obtain the continuous mapping relationship from pixel position and temperature to wavelength.
[0008] Furthermore, in step S1, the reference spectral lines provided by the standard light source or standard substance are dispersed across the entire operating wavelength range of the spectrometer, and the wavelength interval between adjacent reference spectral lines meets the instrument's resolution requirements.
[0009] Furthermore, in step S3, the expression of the two-dimensional polynomial in the standardized variable space is: ; in, and These are the standardized pixel position and temperature variables, respectively. For the standardized wavelength variable, These are the regression coefficients of the model.
[0010] Furthermore, in step S3, the general expression of the two-dimensional polynomial in the standardized variable space is: ; in, and These are the standardized pixel position and temperature variables, respectively. For the standardized wavelength variable, denoted as polynomial coefficients, and d is the upper bound of the polynomial order.
[0011] Furthermore, in step S4, the ridge regression method is used to establish a mapping model from pixel position and temperature to wavelength. The objective function of this model is defined as: ; Where N represents the number of calibration samples, w is the model parameter vector, and α is the ridge regression regularization coefficient. The eigenvectors are the eigenspaces of the two-dimensional polynomial in the standardized variable space.
[0012] Furthermore, the model parameters obtained in step S4 include: constant term parameters, pixel position parameters, temperature parameters, pixel position and temperature cross term parameters, and standardized parameters of the input variables; the model parameters are stored in a storage device that can be read and called by the processor.
[0013] This invention also provides a method for correcting wavelength temperature drift in a spectrometer, using the pixel position and temperature-to-wavelength mapping model described in any of the above-mentioned methods. The correction method includes the following steps: during the actual operation of the spectrometer, a host computer system or embedded processing unit reads the model parameters obtained by solving the mapping model from a storage device, and reconstructs the mapping model according to the correction model establishment method; obtains the real-time operating temperature, inputs the real-time pixel position of the detector and the real-time operating temperature into the mapping model, obtains the continuous mapping relationship between pixel position and temperature to wavelength, and thus obtains the predicted value of the actual wavelength after temperature drift correction.
[0014] Furthermore, based on the continuous mapping relationship between pixel position and temperature to wavelength, the original spectral data is converted from pixel coordinates to wavelength coordinates; the converted spectrum is resampled in the wavelength dimension to map it to a preset standard wavelength axis, thus obtaining temperature drift corrected spectral data.
[0015] Furthermore, the resampling step includes: constructing an intermediate-state spectrum based on the predicted actual wavelength values of each pixel obtained under the current operating temperature conditions, which is expressed in the following form: ,in Let T be the wavelength corresponding to the k-th pixel at temperature T. Here, M represents the original spectral intensity value at the pixel location, and M is the total number of detector pixels. The wavelength axis of this intermediate spectrum is non-uniformly sampled. The intermediate spectrum is mapped to the preset equally spaced wavelength axis using a wavelength domain interpolation function, the expression of which is: The corrected spectral intensity sequence is obtained, wherein the preset equally spaced wavelength axes are represented as follows: , The wavelength points are evenly distributed, and L is the number of wavelength sampling points.
[0016] Furthermore, the wavelength domain interpolation function adopts a cubic interpolation form; for target wavelength points that exceed the wavelength range of the intermediate state spectrum, a zero-filling method is used.
[0017] Furthermore, the model parameters include constant parameters, pixel position parameters, temperature parameters, pixel position and temperature cross-term parameters, and standardized parameters of the input variables.
[0018] This invention also provides a wavelength temperature drift correction system for a spectrometer, comprising: a data acquisition module, used to acquire spectral data of reference spectral lines using a standard light source or standard substance with known characteristic wavelengths under different stable temperature conditions of the spectrometer, simultaneously recording the detector pixel position and corresponding operating temperature information, and obtaining calibration data between pixel position, temperature and reference wavelength; a dataset construction module, used to construct a sample dataset based on the calibration data, wherein pixel position and temperature are input variables and the corresponding reference wavelength is an output variable; a feature space construction module, used to construct a two-dimensional polynomial feature space using pixel position and temperature as input variables, wherein the two-dimensional polynomial includes at least a constant term, a first-order term of pixel position, a second-order term of pixel position, a first-order term of temperature, a second-order term of temperature, and a cross term between pixel position and temperature, and normalizes or standardizes the input and output variables of the two-dimensional polynomial; and a model training module, used to establish a model from pixel position and temperature to the reference wavelength using ridge regression based on the two-dimensional polynomial feature space. A wavelength mapping model is used, the objective function of which consists of a fitting error term and a regularization term, where the regularization term is the product of the L2 norm of the model parameters and the regularization coefficient. The model parameters are solved by minimizing the objective function to obtain a continuous mapping relationship from pixel position and temperature to wavelength. A real-time prediction module is used during the actual operation of the spectrometer. The host computer system or embedded processing unit reads the model parameters obtained from the mapping model from the storage device and reconstructs the mapping model according to the correction model establishment method. The real-time operating temperature is obtained, and the real-time pixel position of the detector and the real-time operating temperature are input into the mapping model to obtain a continuous mapping relationship from pixel position and temperature to wavelength, thereby obtaining the predicted value of the actual wavelength after temperature drift correction. A resampling correction module is used to convert the original spectral data from pixel coordinates to wavelength coordinates based on the continuous mapping relationship from pixel position and temperature to wavelength. The converted spectrum is resampled in the wavelength dimension to map it to a preset standard wavelength axis, obtaining spectral data after temperature drift correction.
[0019] The present invention also provides a spectrometer, comprising: a spectral detector for acquiring spectral data; a temperature sensor for real-time detection of the spectrometer's operating temperature; a storage device for storing model parameters obtained in the spectrometer wavelength temperature drift correction model establishment method; and a control unit, including a host computer system or an embedded processing unit, wherein the control unit is used to execute the spectrometer wavelength temperature drift correction method to achieve wavelength temperature drift correction of the spectrometer.
[0020] The wavelength temperature drift correction model establishment method, correction method, and correction system for spectrometers provided by this invention, compared with existing technologies, introduce a two-dimensional polynomial model by using pixel position and operating temperature as joint independent variables to characterize the nonlinear characteristics of the mapping relationship between pixel position and wavelength as a function of temperature. Furthermore, it accurately describes the coupling relationship between the two through a modeling method including cross terms, enabling the established wavelength mapping model to possess high correction accuracy and good robustness over a wide temperature range, effectively improving the wavelength stability and consistency of the spectrometer under multiple temperature conditions. Addressing the problem that existing machine learning methods heavily rely on large-scale training samples and complex computational resources, this invention employs a physically meaningful two-dimensional polynomial modeling and ridge regression parameter constraint method. This requires only a limited number of reasonably distributed calibration spectral line data to complete the model construction, significantly reducing the dependence on data size while ensuring correction accuracy, and enabling rapid establishment and online application of the temperature drift correction model. In particular, the established mapping model from pixel position and temperature to wavelength is represented by a finite number of regression coefficients. The relevant model parameters can be directly written into the spectrometer's storage device and recalled during instrument operation based on the real-time operating temperature, without the need for additional temperature compensation hardware or complex control modules, significantly reducing system hardware costs. Simultaneously, when the working environment or device state changes, the temperature drift correction model can be rapidly reconstructed by recalibrating and updating the model coefficients, demonstrating good engineering feasibility and flexibility. Based on two-dimensional joint modeling of pixel position and temperature, this invention introduces an intermediate-state non-uniform wavelength axis representation and maps the corrected spectral data to a unified standard wavelength axis through wavelength domain interpolation reconstruction, effectively eliminating systematic resampling errors caused by temperature drift and improving wavelength consistency and quantitative analysis reliability in complex multi-spectral-line scenarios. Attached Figure Description
[0021] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings represent similar elements. Unless otherwise stated, the figures in the drawings do not constitute a limitation on scale.
[0022] Figure 1 This is a schematic diagram illustrating the implementation steps of the method for establishing a wavelength temperature drift correction model for a spectrometer in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the process of establishing the spectrometer wavelength temperature drift correction model in an embodiment of the present invention; Figure 3 This is the online real-time correction process for the spectrometer wavelength temperature drift correction method in this embodiment of the invention; Figure 4 This is a schematic diagram of the wavelength residual distribution before and after reference spectral line correction in an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the various embodiments of this invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this invention to facilitate a better understanding of this application. However, the technical solutions claimed in the claims of this application can be implemented even without these technical details and with various variations and modifications based on the following embodiments.
[0024] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a specific posture. If the specific posture changes, the directional indicators will also change accordingly.
[0025] like Figure 1-2 As shown, one embodiment of the present invention relates to a method for establishing a wavelength temperature drift correction model for a spectrometer, comprising the following steps: S1 Multi-Temperature Spectral Data Acquisition: Under different stable temperature conditions of the spectrometer, spectral data of reference spectral lines are acquired using a standard light source or standard material with known characteristic wavelengths. The position of each pixel of the detector and the corresponding operating temperature are recorded simultaneously to obtain calibration data containing pixel position, temperature and reference wavelength. Specifically, under normal operating conditions of the spectrometer, reference spectral lines that provide known reference wavelengths are selected as the calibration targets. The source of these reference spectral lines is not limited to a specific type and can be a standard light source or a standard substance with clearly defined characteristic spectral lines. To ensure the stability and accuracy of the subsequent modeling process, the selected reference spectral lines with known reference wavelengths should have a sufficient number and reasonable distribution characteristics within the spectrometer's operating band. That is, the reference spectral lines should be dispersed across the entire operating band of the spectrometer, avoiding excessive concentration of reference spectral lines in local band regions. At the same time, the wavelength interval between adjacent reference spectral lines should meet the instrument's resolution requirements to ensure that the spectral line positions can be stably distinguished and accurately extracted, thereby providing sufficient and balanced constraints for subsequent modeling.
[0026] Spectral data corresponding to the reference spectral lines are acquired under different operating temperature conditions, allowing the spectrometer to experience multiple temperature states within its normal operating temperature range. The temperature change method and temperature gradient are not specifically limited and can be set according to actual application conditions. At each temperature state, the pixel position of the reference spectral line on the detector is recorded, and the corresponding operating temperature information is simultaneously acquired to construct calibration data for pixel position, temperature, and reference wavelength.
[0027] To improve data reliability, multiple measurements can be performed under the same temperature conditions, and the results can be statistically processed to reduce the impact of random fluctuations on the extracted spectral line positions. Using this method, a temperature drift correction dataset that meets the spectral line distribution standards is generated, providing a reliable data foundation for the subsequent establishment of a wavelength temperature drift correction model.
[0028] S2 Data Filtering and Consistency Processing, Constructing a Sample Dataset: Construct a sample dataset based on the calibration data, where pixel position and temperature are input variables and the corresponding reference wavelength is the output variable; Specifically, after acquiring calibration data by collecting spectral data under multiple temperature conditions, the obtained calibration data needs to be screened and processed for consistency in order to construct a sample dataset for temperature drift correction modeling.
[0029] The acquired spectral data contains non-ideal data caused by noise fluctuations, unstable light sources, or measurement anomalies. By judging the signal-to-noise ratio characteristics, peak shape integrity, and positional discernibility of the reference spectral lines, spectral line data that do not meet the stable extraction conditions are removed, thereby avoiding interference from abnormal data in the modeling of the relationship between pixel position and temperature.
[0030] For multiple sets of spectral data obtained under the same temperature conditions, statistical processing is performed on the pixel positions corresponding to the same reference spectral line to reduce the impact of random fluctuations on the spectral line position extraction results. By summarizing the repeated measurement results, representative data that can characterize the spectral line position characteristics under that temperature condition is formed.
[0031] Meanwhile, the distribution of the filtered data in the pixel and temperature dimensions is constrained to ensure that the data covers the effective pixel range of the spectral detector and has a reasonable distribution within the temperature variation range, thereby avoiding the adverse effects of excessive data centralization or local missing data on modeling accuracy.
[0032] After the above screening and consistency processing, a temperature drift correction sample dataset that meets the requirements of stability, representativeness and reasonable distribution is formed, providing a reliable data foundation for subsequent joint modeling of pixel position and temperature.
[0033] S3 Pixel Position and Temperature Two-Dimensional Joint Modeling: A two-dimensional polynomial feature space is constructed using the pixel position p and the temperature T as input variables. The two-dimensional polynomial includes at least a constant term, a first-order term of p, a first-order term of T, a second-order term of p, a second-order term of T, and a cross term between p and T. The input variables and output wavelength data of the two-dimensional polynomial are normalized or standardized.
[0034] In one example, to accurately describe the wavelength response characteristics of the spectrometer under different operating temperatures, a two-dimensional joint modeling method of pixel position and temperature is introduced to establish the mapping relationship between pixel position and wavelength as a function of temperature. Let the pixel position of the spectrometer detector be p, the operating temperature of the spectrometer be T, and the corresponding calibration wavelength be... To reduce the impact of differences in the dimensions of different physical quantities on the modeling process, pixel positions and temperatures are standardized to obtain dimensionless variables. and Its definition ,in and These represent the mean and standard deviation of the pixel location, respectively. and These represent the mean and standard deviation of the temperature, respectively. This processing ensures that the pixel location and the temperature variable are aligned on a numerical scale, improving the stability of subsequent modeling processes.
[0035] In one example, a two-dimensional second-order polynomial relating pixel position and temperature is used to model wavelength to describe the nonlinear effect of temperature changes on the spectrometer pixel position-wavelength mapping. In the normalized variable space, the wavelength mapping is expressed as... ,in, For the standardized wavelength variable, For the standardized pixel position variables, For the standardized temperature variable, These are the regression coefficients for the model. This expression includes a pixel location term, a temperature term, and their interaction term, used to characterize the coupling relationship between pixel location and temperature changes.
[0036] By denormalizing the prediction results in the normalized space, the wavelength value in the actual physical sense can be obtained, and its expression is: ,in, and These represent the mean and standard deviation of the wavelength samples, respectively.
[0037] One embodiment relates to a general two-dimensional polynomial modeling form to adapt to different types of spectrometers and application scenarios with varying temperature drift characteristics. This general model is represented in the normalized variable space as follows: ; in, Here, is the polynomial coefficient, and d is the upper bound of the polynomial order. For the standardized wavelength variable, For the standardized pixel position variables, The temperature variable is standardized. By appropriately selecting the polynomial order and characteristic terms, the model complexity can be controlled while ensuring modeling accuracy, thereby achieving stable modeling and correction of the spectrometer's temperature drift behavior.
[0038] S4 Solving Model Parameters: Based on the two-dimensional polynomial feature space, a mapping model from pixel position and temperature to wavelength is established using the ridge regression method. The objective function of this mapping model includes a fitting error term and a regularization term. The regularization term is the product of the L2 norm of the model parameters and the regularization coefficient. By minimizing the objective function, the model parameters are solved to obtain the continuous mapping relationship from pixel position and temperature to wavelength.
[0039] In one example, after constructing a two-dimensional polynomial feature space of pixel location and temperature, the model parameters are solved to determine the mapping relationship between pixel-temperature-wavelength.
[0040] The polynomial eigenvectors formed in the standardized variable space are represented as follows: The corresponding model parameter vector is represented as Then the wavelength prediction model can be uniformly expressed as: .
[0041] With increased polynomial order and coupling of pixel and temperature features, strong correlations easily arise among model parameters, leading to instability in ordinary least squares solutions under varying temperature conditions. To improve the robustness of the model under multiple temperature conditions, this embodiment introduces ridge regression constraints during parameter solving. By adding a parameter norm 2 penalty term to the error function, the model complexity is constrained. The objective function is defined as follows: ; Where N represents the number of calibration samples, and α is the ridge regression regularization coefficient, which is used to suppress parameter oscillations caused by higher-order polynomial features and enhance the model's adaptability to temperature disturbances.
[0042] By solving the ridge regression optimization model described above, a parameter solution that balances fitting accuracy and parameter stability can be obtained. The value of the regularization coefficient α can be adjusted according to the temperature variation range of the spectrometer, the sample distribution density, and the residual characteristics, thereby achieving reliable temperature drift correction under different application conditions.
[0043] Based on the ridge regression constraint solution method described above, this invention does not limit the specific form of the regularization term. The parameter solution method can be extended to other regression models that satisfy stability constraints to adapt to the temperature drift characteristics of different spectrometer systems.
[0044] One embodiment of the present invention relates to a method for establishing a wavelength temperature drift correction model for a spectrometer. The specific operation of multi-temperature spectral data acquisition involves selecting multiple characteristic spectral lines with clear physical attributes and commonly used in spectral analysis as reference spectral lines for wavelength calibration. The reference wavelengths corresponding to these reference spectral lines cover the effective operating band of the instrument and maintain a balanced distribution along the wavelength axis. Table 1 shows the details of the center wavelengths and elemental assignments of each reference spectral line. Table 1. Detailed list of reference spectral line center wavelengths and elemental assignments
[0045] As shown in Table 1, the reference spectral lines all originate from the same elemental system and have the characteristics of stable spectral intensity, clear peak shape and good repeatability. They are suitable as constraints for pixel-wavelength mapping models, thereby reducing the impact of multi-element aliasing on the modeling results.
[0046] In terms of temperature, to characterize the wavelength drift characteristics of the spectral system caused by environmental or device temperature increases during actual operation, multiple discrete temperature gradients were selected to construct a joint calibration dataset. These temperature gradients cover the typical operating range of the system, with temperature values including 15.4588 ℃, 19.4345 ℃, 24.7261 ℃, 29.5535 ℃, 34.1023 ℃, and 37.8969 ℃. By collecting spectral data of the aforementioned characteristic spectra under different temperature conditions, a holistic sample space for wavelength mapping relationships as a function of temperature was established, thereby obtaining calibration data containing pixel position, temperature, and reference wavelength. By introducing a joint modeling approach across temperature gradients, the resulting model can simultaneously characterize the combined impact of pixel position and temperature changes on wavelength shift, providing a reliable data foundation for subsequent temperature drift correction and real-time compensation.
[0047] One embodiment of the present invention relates to a method for establishing a wavelength temperature drift correction model for a spectrometer. Based on acquired calibration data, using pixel position and temperature as input variables and the corresponding reference wavelength as output variables, a two-dimensional polynomial feature space of pixel position and temperature is constructed. Ridge regression is then used to model the mapping relationship between pixel position, temperature, and wavelength. The model parameters are solved by minimizing the objective function. These model parameters include at least constant parameters, pixel position parameters, temperature parameters, pixel position and temperature cross-term parameters, and standardized parameters of the input variables. The constant parameters describe the reference wavelength offset when both the pixel position and operating temperature are reference values. The pixel position parameters describe the mapping relationship between wavelength and pixel position, including coefficients of different orders of pixel position terms, to characterize the nonlinear characteristics of the relationship between pixel position and wavelength. The temperature parameters describe the wavelength drift characteristics with changes in operating temperature, including coefficients of different orders of temperature terms, to characterize the influence of temperature changes on the wavelength mapping relationship. The pixel position and temperature cross-term parameter describes the coupled effect of pixel position and operating temperature on the wavelength mapping relationship. This cross-term parameter compensates for the nonlinear shift in the pixel position-wavelength relationship under temperature variations. The input variable standardization parameters include the mean and scale parameters of pixel position and operating temperature during the modeling phase. These parameters are used to standardize the input data during the runtime phase, ensuring the numerical stability of the model calculation process.
[0048] In practice, the above-mentioned parameters can be written into the non-volatile storage device of the spectrometer in the form of parameter arrays, parameter tables or key-value pairs in a predetermined order, such as flash memory, EEPROM or other storage media that can store data for a long time.
[0049] like Figure 3 As shown, one embodiment of the present invention relates to a method for correcting wavelength temperature drift of a spectrometer, which is implemented by using the pixel position and temperature-to-wavelength mapping model constructed in the above-mentioned spectrometer wavelength temperature drift correction model establishment method, and the model parameters obtained by solving the mapping model.
[0050] Specifically, during the operation of the spectrometer, the host computer system or embedded processing unit reads the model parameters obtained from the above-mentioned mapping model from the storage device, and reconstructs the mapping model from pixel position and temperature to wavelength based on the aforementioned pixel position and temperature joint modeling method. The real-time acquired pixel position data and the current operating temperature data are substituted into the mapping model to obtain a continuous mapping relationship from pixel position and temperature to wavelength, predicting the actual wavelength position corresponding to each pixel of the detector, thereby obtaining the predicted value of the actual wavelength after temperature drift correction, and completing the prediction and temperature drift correction of the corresponding wavelength. It should be noted that this embodiment does not limit the specific order, number, or arrangement order of the model parameters, as long as the model parameters can completely characterize the influence of pixel position and operating temperature on the wavelength mapping relationship, and can be written into the spectrometer's storage device and read and called during operation. Preferably, the spectrometer wavelength temperature drift correction method further includes converting the original spectral data from pixel coordinates to wavelength coordinates based on the continuous mapping relationship from pixel position and temperature to wavelength; resampling the converted spectrum in the wavelength dimension to map it to a preset standard wavelength axis, obtaining the spectral data after temperature drift correction.
[0051] One embodiment involves a method for wavelength temperature drift correction in a spectrometer. Since the pixel position index is based on equally spaced discrete sampling, and the mapping relationship between the pixel position and wavelength after temperature drift correction is typically a non-linear function, the predicted wavelength sequence is no longer strictly equally spaced along the wavelength axis. Directly performing spectral analysis based on this non-uniform wavelength axis would be detrimental to spectral line alignment, peak position search, and quantitative analysis, and would easily introduce systematic errors.
[0052] For the reasons mentioned above, after obtaining the continuous mapping relationship between pixel position and temperature to wavelength, an intermediate state spectrum and wavelength interpolation reconstruction method is introduced. Through interpolation, the spectral data of non-uniform wavelength sampling is remapped back to a uniformly preset equally spaced wavelength axis to obtain the spectral data after temperature drift correction, thereby obtaining the final corrected spectral data that is more conducive to spectral analysis.
[0053] Specifically, during the actual operation of the spectrometer, raw spectral data is acquired, with pixel position index as the independent variable and spectral intensity as the dependent variable. Given the current operating temperature T, pixel position and temperature are used as inputs. Utilizing a pre-trained mapping model from pixel position and temperature to wavelength, the actual wavelength corresponding to each pixel is predicted, constructing an intermediate-state spectrum, which is expressed as follows: ,in, Let I be the wavelength corresponding to the k-th pixel predicted by the model at temperature T. k This represents the original spectral intensity value at this pixel, where M is the total number of detector pixels. This intermediate-state spectrum reflects the true wavelength distribution after temperature correction, but its wavelength axis is non-uniformly sampled.
[0054] To restore a unified wavelength sampling reference, the wavelength sequence in the original spectral file is used as the target wavelength axis. ,in The wavelength points are evenly distributed, and L is the number of wavelength sampling points.
[0055] By constructing a wavelength domain interpolation function Mapping the intermediate-state spectrum to the target wavelength axis, its expression is: .
[0056] Preferably, a cubic interpolation function is used to ensure the continuity and peak shape preservation of the spectral curve during the interpolation process. For points outside the intermediate wavelength range, zero-filling is used to avoid extrapolation errors.
[0057] Through the above interpolation process, a spectral intensity sequence with the original wavelength axis as the independent variable and corrected for temperature drift can be obtained, thus forming the final corrected spectrum.
[0058] In one example, a spectrometer with an operating temperature of 30°C was used as the test object to verify the wavelength temperature drift correction method for the spectrometer proposed above. The effective operating wavelength range of the spectrometer is 194~970nm, the number of detector pixels is 1024, and the raw spectral data is acquired in an equal pixel interval manner.
[0059] Under these test conditions, the original spectral data of the spectrometer at 30℃ was first acquired. Based on the trained pixel position and temperature-to-wavelength mapping model, the actual wavelength of each pixel under the current temperature condition was predicted to construct the intermediate spectrum. Then, the intermediate spectrum was remapped to the original equally spaced wavelength axis using the wavelength domain interpolation method to obtain the temperature drift corrected spectral data.
[0060] Using characteristic spectral lines with known center wavelengths from a mercury-argon lamp as evaluation benchmarks, peak positions of each standard spectral line were searched in both the original and corrected spectra, and the absolute deviations from the standard wavelengths were calculated. Statistical results show that in the uncorrected original spectrum, the average absolute wavelength deviation of each characteristic spectral line was 0.578 nm. After correction using the spectrometer wavelength temperature drift correction method provided in this invention, the average absolute wavelength deviation of each characteristic spectral line in the spectrum was reduced to 0.254 nm, corresponding to an average absolute deviation improvement of 0.324 nm. Compared to the original spectrum, the deviation improvement rate reached 56%.
[0061] The above results show that by introducing two-dimensional joint modeling of pixel position and temperature, and combining it with wavelength domain interpolation reconstruction method, wavelength drift of the spectrometer can be significantly suppressed under actual operating temperature conditions, and the consistency between spectral peak position and standard wavelength can be improved.
[0062] like Figure 4 As shown, to further visually reflect the changes in spectral peak position deviation before and after correction, a residual distribution diagram of the center wavelength corresponding to the reference spectral lines in Table 1 is plotted to compare the overall distribution characteristics of peak position deviation in the original and corrected spectra. The comparison of the residual distribution shows that the peak position residuals of the corrected spectral lines shift towards zero and exhibit a more concentrated distribution trend, further verifying the effective correction capability of the method of this invention for temperature drift under actual spectral measurement conditions.
[0063] One embodiment of the present invention relates to a wavelength temperature drift correction system for a spectrometer, used to implement the wavelength temperature drift correction method for a spectrometer in the above embodiment, comprising: a data acquisition module, used to acquire spectral data using a standard light source or standard substance with known characteristic wavelengths under different stable temperature conditions of the spectrometer, simultaneously recording the detector pixel position and corresponding operating temperature information, and obtaining calibration data between pixel position, temperature and reference wavelength; a dataset construction module, used to construct a sample dataset based on the calibration data, wherein pixel position and temperature are input variables and the corresponding reference wavelength is an output variable; a feature space construction module, used to construct a two-dimensional polynomial feature space with pixel position p and temperature T as input variables, wherein the two-dimensional polynomial includes at least a constant term, a first-order term of pixel position, a second-order term of pixel position, a first-order term of temperature, a second-order term of temperature, and a cross term of pixel position and temperature, and normalizes or standardizes the input and output variables of the two-dimensional polynomial; and a model training module, used to establish a mapping model from pixel position and temperature to wavelength using ridge regression based on the two-dimensional polynomial feature space, wherein the objective function of the model consists of a fitting error term and a regularization term. The regularization term is the product of the L2 norm of the model parameters and the regularization coefficient. The model parameters are solved by minimizing the objective function to obtain a continuous mapping relationship between pixel position and temperature to wavelength. Preferably, the solved model parameters include: constant parameters, pixel position parameters, temperature parameters, pixel position and temperature cross-term parameters, and standardized parameters of the input variables. The model parameters are stored in a storage device that can be read and accessed by a processor. A real-time prediction module is used, during the actual operation of the spectrometer, for the host computer system or embedded processing unit to read the model parameters obtained from the mapping model from the storage device and reconstruct the mapping model according to the correction model establishment method. The real-time operating temperature is obtained, and the real-time pixel position of the detector and the real-time operating temperature are input into the mapping model to obtain a continuous mapping relationship between pixel position and temperature to wavelength, thereby obtaining the predicted value of the actual wavelength after temperature drift correction. A resampling correction module is used to convert the original spectral data from pixel coordinates to wavelength coordinates based on the continuous mapping relationship between pixel position and temperature to wavelength. The converted spectrum is resampled in the wavelength dimension to map it to a preset standard wavelength axis, obtaining spectral data after temperature drift correction.
[0064] One embodiment of the present invention relates to a spectrometer, comprising: a spectral detector for acquiring spectral data; a temperature sensor for real-time detection of the spectrometer's operating temperature; a storage device for storing model parameters; the model parameters being obtained by solving the pixel position and temperature-to-wavelength mapping model constructed in the above-described spectrometer wavelength temperature drift correction model establishment method; and a control unit communicatively connected to the temperature sensor, the spectral detector, and the storage device. The control unit includes a host computer system or an embedded processing unit, and the control unit is used to execute the above-described spectrometer wavelength temperature drift correction method to achieve wavelength temperature drift correction of the spectrometer. Specifically, during the operation of the spectrometer, the host computer system or embedded processing unit reads the model parameters obtained from the mapping model from the storage device, establishes a pixel position and temperature-to-wavelength mapping model, and obtains a continuous mapping relationship between pixel position and temperature-to-wavelength through the mapping model based on the pixel position information of the detector and the operating temperature information fed back by the temperature sensor, thereby obtaining the predicted value of the actual wavelength after temperature drift correction, and realizing the wavelength temperature drift correction of the spectrometer.
[0065] The wavelength temperature drift correction method for spectrometers provided in this invention differs from the dynamic temperature drift compensation-based crop spectrometer temperature drift calibration method disclosed in the prior art patent (CN121230870A). The prior art patent, based on compressed sensing or regularized reconstruction frameworks, requires constructing an M×N dimensional system response matrix, where M is the number of reconstructed wavelength points and N is the number of detector pixels. Furthermore, it requires maintaining multiple sets of regularization parameter matrices under temperature variation conditions. Its implementation involves large-scale matrix inversion or iterative optimization, with a computational complexity of O(M²·N) or O(M·N·iterations). In a typical configuration of 1024 pixels × 512 wavelength points, a single reconstruction requires approximately 5 × 10⁻⁶ iterations. 8 The floating-point operation takes approximately 100-500 milliseconds on an embedded DSP platform. In contrast, this invention, with the same spectral detector size (1024 pixels), establishes a direct mapping from pixel position p to temperature T to wavelength λ using a two-dimensional second-order polynomial. The model has only 6 parameters and involves only about 20 multiply-accumulate operations, taking less than 10 microseconds on the same embedded platform, resulting in a computational efficiency improvement of over 10,000 times. Regarding data storage, the patent requires pre-storing an M×N dimensional filter response matrix and temperature calibration matrix, occupying approximately 10-50MB of storage space, while this invention only needs to store 6 regression coefficients, requiring less than 48 bytes. Furthermore, the patent requires collecting complete M×N dimensional spectral data cubes at multiple temperature points to construct regularization constraints during the temperature calibration stage, resulting in data volumes in the GB range. This invention only needs to extract the pixel positions of 4-8 feature spectral lines at each temperature point, compressing the data volume to the KB level. This significantly reduces the dependence on data volume and computing resources while maintaining correction accuracy.
[0066] The wavelength temperature drift correction model establishment method, correction method, and correction system for spectrometers provided by this invention introduce a two-dimensional polynomial model by using pixel position and operating temperature as joint independent variables to characterize the nonlinear characteristics of the mapping relationship between pixel position and wavelength as a function of temperature. Furthermore, the modeling method including cross terms accurately describes the coupling relationship between the two, enabling the established wavelength mapping model to possess high correction accuracy and good robustness over a wide temperature range, effectively improving the wavelength stability and consistency of the spectrometer under multiple temperature conditions. Addressing the issue of existing machine learning methods' strong dependence on large-scale training samples and complex computational resources, this invention employs a physically meaningful two-dimensional polynomial modeling and ridge regression parameter constraint method. This requires only a limited number of reasonably distributed calibration spectral line data to complete the model construction, significantly reducing the dependence on data scale while ensuring correction accuracy, thus enabling rapid establishment and online application of the temperature drift correction model. In particular, the established mapping model from pixel position and temperature to wavelength is represented by a finite number of regression coefficients. The relevant model parameters can be directly written into the spectrometer's storage device and recalled during instrument operation based on the real-time operating temperature, without the need for additional temperature compensation hardware or complex control modules, significantly reducing system hardware costs. Simultaneously, when the working environment or device state changes, the temperature drift correction model can be rapidly reconstructed by recalibrating and updating the model coefficients, demonstrating good engineering feasibility and flexibility. Based on two-dimensional joint modeling of pixel position and temperature, this invention introduces an intermediate-state non-uniform wavelength axis representation and maps the corrected spectral data to a unified standard wavelength axis through wavelength domain interpolation reconstruction, effectively eliminating systematic resampling errors caused by temperature drift and improving wavelength consistency and quantitative analysis reliability in complex multi-spectral-line scenarios.
[0067] Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications and improvements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be defined by the claims.
Claims
1. A method for establishing a wavelength temperature drift correction model for a spectrometer, characterized in that, Includes the following steps: S1: Under different stable temperature conditions of the spectrometer, use a standard light source or standard material with known characteristic wavelengths to collect spectral data of reference spectral lines, and simultaneously record the position of each pixel of the detector and the corresponding operating temperature to obtain calibration data including pixel position, temperature and reference wavelength. S2: Construct a sample dataset based on the calibration data, wherein pixel position and temperature are input variables and the corresponding reference wavelength is the output variable; S3: Construct a two-dimensional polynomial feature space using the pixel position p and the temperature T as input variables. The two-dimensional polynomial includes at least a constant term, a first-order term of p, a first-order term of T, a second-order term of p, a second-order term of T, and a cross term between p and T. The input variables and output wavelength data of the two-dimensional polynomial are normalized or standardized. S4: Based on the two-dimensional polynomial feature space, a mapping model from pixel position and temperature to wavelength is established using the ridge regression method. The objective function of this mapping model includes a fitting error term and a regularization term. The regularization term is the product of the L2 norm of the model parameters and the regularization coefficient. By minimizing the objective function, the model parameters are solved to obtain the continuous mapping relationship from pixel position and temperature to wavelength.
2. The method for establishing a wavelength temperature drift correction model for a spectrometer according to claim 1, characterized in that, In step S1, the reference spectral lines provided by the standard light source or standard substance are dispersed across the entire operating wavelength range of the spectrometer, and the wavelength interval between adjacent reference spectral lines meets the instrument's resolution requirements.
3. The method for establishing a spectrometer wavelength temperature drift correction model according to claim 1, characterized in that, In step S3, the expression of the two-dimensional polynomial in the standardized variable space is: ; in, and These are the standardized pixel position and temperature variables, respectively. For the standardized wavelength variable, These are the regression coefficients of the model.
4. The method for establishing a spectrometer wavelength temperature drift correction model according to claim 1, characterized in that, In step S3, the general expression of the two-dimensional polynomial in the standardized variable space is: ; in, and These are the standardized pixel position and temperature variables, respectively. For the standardized wavelength variable, denoted as polynomial coefficients, and d is the upper bound of the polynomial order.
5. The method for establishing a spectrometer wavelength temperature drift correction model according to claim 3 or 4, characterized in that, In step S4, the ridge regression method is used to establish a mapping model from pixel position and temperature to wavelength. The objective function of this model is defined as: ; Where N represents the number of calibration samples, w is the model parameter vector, and α is the ridge regression regularization coefficient. The eigenvectors are the eigenspaces of the two-dimensional polynomial in the standardized variable space.
6. The method for establishing a wavelength temperature drift correction model for a spectrometer according to claim 1, characterized in that, The model parameters obtained in step S4 include: constant term parameters, pixel position parameters, temperature parameters, pixel position and temperature cross term parameters, and standardized parameters of the input variables; the model parameters are stored in a storage device that can be read and called by the processor.
7. A method for correcting wavelength temperature drift in a spectrometer, characterized in that, Using the pixel position and temperature-to-wavelength mapping model of any one of claims 1-6, the correction method includes the following steps: During the actual operation of the spectrometer, the host computer system or embedded processing unit reads the model parameters obtained by solving the mapping model from the storage device, and reconstructs the mapping model according to the correction model establishment method; obtains the real-time operating temperature, inputs the real-time pixel position of the detector and the real-time operating temperature into the mapping model, obtains the continuous mapping relationship from pixel position and temperature to wavelength, and thus obtains the predicted value of the actual wavelength after temperature drift correction.
8. The method for correcting wavelength temperature drift of a spectrometer according to claim 7, characterized in that, Based on the continuous mapping relationship between pixel position and temperature to wavelength, the original spectral data is converted from pixel coordinates to wavelength coordinates; the converted spectrum is resampled in the wavelength dimension to map it to a preset standard wavelength axis, thus obtaining temperature drift corrected spectral data.
9. The method for correcting wavelength temperature drift in a spectrometer according to claim 8, characterized in that, The resampling step includes: Based on the predicted actual wavelength values of each pixel obtained under the current operating temperature conditions, an intermediate-state spectrum is constructed, which is expressed in the following form: ,in Let T be the wavelength corresponding to the k-th pixel at temperature T. Here, M represents the original spectral intensity value at the pixel location, and M is the total number of detector pixels. The wavelength axis of this intermediate spectrum is non-uniformly sampled. The intermediate spectrum is mapped to the preset equally spaced wavelength axis using a wavelength domain interpolation function, the expression of which is: The corrected spectral intensity sequence is obtained, wherein the preset equally spaced wavelength axes are represented as follows: , The wavelength points are evenly distributed, and L is the number of wavelength sampling points.
10. The method for correcting wavelength temperature drift in a spectrometer according to claim 9, characterized in that, The wavelength domain interpolation function adopts a cubic interpolation form; for target wavelength points that exceed the wavelength range of the intermediate spectral state, a zero-filling method is used.
11. The method for correcting wavelength temperature drift of a spectrometer according to claim 7, characterized in that, The model parameters include constant parameters, pixel position parameters, temperature parameters, pixel position and temperature cross-term parameters, and standardized parameters of the input variables.
12. A wavelength temperature drift correction system for a spectrometer, characterized in that, include: The data acquisition module is used to acquire spectral data of reference spectral lines using a standard light source or standard substance with known characteristic wavelengths under different stable temperature conditions of the spectrometer, and simultaneously record the detector pixel position and corresponding operating temperature information to obtain calibration data between pixel position, temperature and reference wavelength. The dataset construction module is used to construct a sample dataset based on the calibration data, wherein pixel position and temperature are input variables and the corresponding reference wavelength is the output variable. The feature space construction module is used to construct a two-dimensional polynomial feature space with pixel position and temperature as input variables. The two-dimensional polynomial includes at least a constant term, a first-order term of pixel position, a second-order term of pixel position, a first-order term of temperature, a second-order term of temperature, and a cross term of pixel position and temperature. The module also performs normalization or standardization processing on the input and output variables of the two-dimensional polynomial. The model training module is used to establish a mapping model from pixel position and temperature to wavelength based on the two-dimensional polynomial feature space using the ridge regression method. The objective function of the model consists of a fitting error term and a regularization term. The regularization term is the product of the L2 norm of the model parameters and the regularization coefficient. By minimizing the objective function, the model parameters are solved to obtain the continuous mapping relationship from pixel position and temperature to wavelength. The real-time prediction module is used to read the model parameters obtained by solving the mapping model from the storage device during the actual operation of the spectrometer by the host computer system or embedded processing unit, and reconstruct the mapping model according to the correction model establishment method; obtain the real-time operating temperature, input the real-time pixel position of the detector and the real-time operating temperature into the mapping model, obtain the continuous mapping relationship from pixel position and temperature to wavelength, and thus obtain the predicted value of the actual wavelength after temperature drift correction. The resampling correction module is used to convert the original spectral data from pixel coordinates to wavelength coordinates based on the continuous mapping relationship between pixel position and temperature to wavelength; and to resample the converted spectrum in the wavelength dimension so that it is mapped to a preset standard wavelength axis to obtain spectral data after temperature drift correction.
13. A spectrometer, characterized in that, include: A spectral detector is used to acquire spectral data; Temperature sensor used to detect the operating temperature of the spectrometer in real time; A storage device for storing model parameters obtained by the method for establishing a wavelength temperature drift correction model for a spectrometer according to claim 1; The control unit includes a host computer system or an embedded processing unit, which is used to execute the wavelength temperature drift correction method of the spectrometer according to any one of claims 7-12, so as to realize the wavelength temperature drift correction of the spectrometer.
Citation Information
Patent Citations
Spectrometer wavelength calibration method, device, equipment and medium
CN120800565A
Crop spectrometer temperature drift calibration method based on dynamic temperature drift compensation
CN121230870A