Spectral temperature measurement method based on deep learning
By constructing an improved CNN model combined with a spectral acquisition device with NV color center, a simplified high-precision temperature measurement of the optical path is achieved, solving the problems of complex optical paths and high noise sensitivity in the prior art, and achieving stable temperature prediction over a wide temperature range.
Patent Information
- Application Number
- CN202510433719.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-07-11
AI Technical Summary
In the prior art, the optical path is complex and the noise sensitivity is high, resulting in large temperature measurement errors and low stability, making it difficult to achieve convenient and stable temperature measurement in industrial or extreme scenarios.
Using a spectral temperature measurement method based on deep learning, the improved CNN model is constructed, combined with the NV color center and spectral acquisition device, automatic feature extraction and temperature prediction of spectral data are realized, the optical path structure is simplified, and temperature prediction is used using deep learning.
It realizes high-precision temperature measurement, with an error of about ±0.6°, adapts to a wide temperature range (30°C to 90°C), and reduces the difficulty of temperature measurement. It is suitable for commonly used temperature zones in biomedical and industrial industries.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present invention relates to a spectral temperature measurement method based on deep learning. Background Art
[0002] The nitrogen-vacancy color center, i.e., the NV color center, is an atomic-level defect in the diamond lattice, composed of a nitrogen atom substituting a carbon atom and an adjacent vacancy. Its unique quantum properties make it a core material for high-sensitivity quantum sensing. However, the NV color center is sensitive to temperature, and the conventional use of ODMR (Optical Detection Magnetic Resonance) technology to measure temperature has the following disadvantages: 1. Dependence on complex optical path design: It is necessary to use waveguides or optical fibers to conduct optical signals, with high hardware costs and susceptibility to environmental vibrations; 2. High noise sensitivity: Weak spectral signals are easily interfered by background noise, and multiple repeated measurements are required. The frequent manual calibration process further limits the real-time monitoring ability in dynamic environments. These limitations make it difficult for existing technologies to achieve convenient and stable temperature measurement in industrial or extreme scenarios. Summary of the Invention
[0003] The purpose of the present invention is to provide a spectral temperature measurement method based on deep learning to solve the problems of large errors and low stability in temperature measurement caused by complex optical paths and high noise sensitivity in the prior art.
[0004] The technical solution of the present invention is as follows: A spectral temperature measurement method based on deep learning, comprising the following steps, S1. Obtain spectral data of the object to be measured at different temperatures within a set temperature range by a spectral acquisition device, and label the actual temperature value corresponding to each spectrum to form a training data set; S2. Construct a spectral temperature measurement model based on an improved CNN. The spectral temperature measurement model based on the improved CNN includes an input layer, a first convolutional layer, a second convolutional layer, a first max-pooling layer, a third convolutional layer, a fourth convolutional layer, a second max-pooling layer, a flattening layer, and a fully connected layer. After the input spectral data passes through the input layer, the first convolutional layer, the second convolutional layer, the first max-pooling layer, the third convolutional layer, the fourth convolutional layer, the second max-pooling layer, and the fully connected layer in sequence, the temperature value corresponding to the spectrum is obtained; S3. After training the spectral temperature measurement model based on the improved CNN using the training data set in step S1, obtain the trained CNN model; S4. After obtaining the spectral data to be measured of the object to be measured by the spectral acquisition device, input the spectral data to be measured into the trained CNN model to obtain the detected temperature value.
[0005] Further, in step S1, spectral data of the object to be measured at different temperatures with a temperature gradient set at intervals of the set temperature within the set temperature range is acquired by the spectral acquisition device.
[0006] Further, in step S2, in the spectral temperature measurement model based on the improved CNN, Input layer: The spectral data is input into the first convolutional layer; First convolutional layer Conv1: After performing convolution operations using a filter of size 5×3, it outputs the first feature map to the second convolutional layer Conv2; Second convolutional layer Conv2: After extracting more advanced features from the input feature map using a filter of size 7×4, it outputs the second feature map to the first max pooling layer Max Pool1; First max pooling layer Max Pool1: After performing max pooling operations on the second feature map for dimensionality reduction, it outputs to the third convolutional layer Conv3; Third convolutional layer Conv3: After performing convolution operations using a filter of size 9×5 to further extract features, it outputs to the fourth convolutional layer Conv4; Fourth convolutional layer Conv4: After performing convolution operations using a filter of size 11×6, it outputs to the second max pooling layer Max Pool2; Second max pooling layer Max Pool2: After performing max pooling operations for dimensionality reduction, it outputs to the flattening layer Flatten; Flattening layer Flatten: After flattening into a long vector, it outputs to the fully connected layer Fully Connected; Fully connected layer Fully Connected: After performing final feature combination and prediction, it obtains the prediction result; Output layer: Outputs the prediction result obtained from the fully connected layer Fully Connected.
[0007] Further, in step S1, the fluorescence wavelength is used for the spectral data.
[0008] Further, in steps S1 and S4, the spectral acquisition device includes a laser generator, a mirror, a dichroic mirror, a first objective lens, a second objective lens, a spectrometer, an optical fiber coupler, an optical fiber, a tapered optical fiber provided at the end of the optical fiber, and a diamond with an NV color center provided at the end of the tapered optical fiber. The diamond with an NV color center is placed within a range less than the set distance from the object to be measured. The laser generator generates a laser, which is adjusted by the mirror and then reflected by the dichroic mirror to reach the second objective lens and be coupled to the optical fiber coupler. The excitation light coupled into the optical fiber excites the diamond NV color center crystal to generate an energy level transition, and when the energy level drops, it emits red fluorescence outward. The red fluorescence generated by the diamond NV color center crystal radiates in all directions. Since the wavelength of the red fluorescence is higher than that of the dichroic mirror, the red fluorescence passes through the dichroic mirror and enters the first objective lens. After being coupled by the first objective lens, the fluorescence is focused into the spectrometer, and the fluorescence wavelength is obtained by spectral analysis of the spectrometer.
[0009] Further, the incident laser of the mirror forms a 90° angle with the emitted laser, the incident laser of the dichroic mirror forms a 90° angle with the laser reflected by the dichroic mirror to the second objective lens, and the dichroic mirror forms a 45° angle with the emitted laser of the laser emitter.
[0010] Further, the laser generator adopts an adjustable laser generator.
[0011] Further, the laser generator generates green laser with a wavelength of 532 nm, and the laser pulse width ranges between 2 ns and 10 ms.
[0012] Further, the second objective lens and the spectrometer are provided with long-pass filters for filtering out stray light.
[0013] The beneficial effects of the present invention are: First, this spectral temperature measurement method based on deep learning combines NV color centers with deep learning to achieve temperature prediction, enabling efficient feature extraction, wide temperature adaptability, spectral temperature measurement, a temperature error of around ±0.6°, a simplified optical path structure, reduced temperature measurement difficulty, and the advantage of high-precision measurement.
[0014] Second, the present invention uses CNN to automatically learn local and global features in the spectrum, enabling efficient feature extraction and predicting the temperature value without directly measuring the temperature.
[0015] Third, this spectral temperature measurement method based on deep learning is the first to achieve waveguide-free spectral temperature measurement, combining NV color centers with deep learning to achieve temperature prediction. It is stable in the range of 30°C to 90°C, covering the commonly used temperature ranges in biomedicine and industry. Description of the Drawings
[0016] Figure 1 is a schematic flow chart of the spectral temperature measurement method based on deep learning in an embodiment of the present invention; Figure 2 is a schematic illustration of the spectral acquisition device in the embodiment; Figure 3 is a schematic illustration of the optical fiber, tapered optical fiber, and diamond with NV color centers in the embodiment; Figure 4 is a schematic illustration of the spectral temperature measurement model based on the improved CNN in the embodiment; Figure 5It is a schematic diagram comparing the detected temperature values and the true temperature values of the spectral temperature measurement method based on deep learning in the range of 30°C to 90°C; Wherein: 1 - laser generator, 2 - mirror, 3 - dichroic mirror, 4 - first objective lens, 5 - second objective lens, 6 - spectrometer, 7 - fiber optic coupler, 8 - object to be measured, 9 - long - pass filter, 10 - optical fiber, 11 - tapered optical fiber, 12 - diamond with NV color centers. Specific embodiments
[0017] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0018] The embodiment provides a spectral temperature measurement method based on deep learning, as Figure 1 follows, including the following steps, S1. The spectral acquisition device acquires spectral data of the object to be measured 8 at different temperatures within a set temperature range, and marks the actual temperature value corresponding to each spectrum to form a training data set.
[0019] In step S1, the spectral acquisition device acquires spectral data of the object to be measured 8 at different temperatures with a temperature gradient set at intervals of the set temperature within the set temperature range. The spectral data uses fluorescence intensity. The object to be measured 8 can be a solid or a liquid, such as a chip, oil, etc.
[0020] S2. Construct a spectral temperature measurement model based on an improved CNN. The spectral temperature measurement model based on an improved CNN includes an input layer, a first convolutional layer, a second convolutional layer, a first max - pooling layer, a third convolutional layer, a fourth convolutional layer, a second max - pooling layer, a flattening layer, and a fully - connected layer. After the input spectral data passes through the input layer, the first convolutional layer, the second convolutional layer, the first max - pooling layer, the third convolutional layer, the fourth convolutional layer, the second max - pooling layer, and the fully - connected layer in sequence, the temperature value corresponding to the spectrum is obtained.
[0021] In the spectral temperature measurement model based on an improved CNN, as Figure 4 follows: Input layer: Input the spectral data into the first convolutional layer; First convolutional layer Conv1: Perform a convolution operation using a filter of size 5×3 and output the first feature map to the second convolutional layer Conv2; Second convolutional layer Conv2: Extract more advanced features from the input feature map using a filter of size 7×4 and output the second feature map to the first max - pooling layer Max Pool1; First max - pooling layer Max Pool1: Perform a max - pooling operation on the second feature map for dimensionality reduction and output it to the third convolutional layer Conv3; The third convolutional layer Conv3: After performing convolutional operations using a filter of size 9×5 to further extract features, it outputs to the fourth convolutional layer Conv4; The fourth convolutional layer Conv4: After performing convolutional operations using a filter of size 11×6, it outputs to the second max pooling layer Max Pool2; The second max pooling layer Max Pool2: After performing max pooling operations for dimensionality reduction, it outputs to the flattening layer Flatten; The flattening layer Flatten: After flattening into a long vector, it outputs to the fully connected layer Fully Connected; The fully connected layer Fully Connected: After performing final feature combination and prediction, it obtains the prediction result; The output layer: Outputs the prediction result obtained from the fully connected layer Fully Connected.
[0022] In step S2, compared with the fact that the convolution kernel size in traditional CNN is usually fixed at 3×3, the spectrum temperature measurement model improved based on CNN flexibly adjusts the size of the convolution kernel according to spectral characteristics (such as from 5 to 11), which is more suitable for broadband signals; the increasing design of the number of filters nf in the convolutional layer (3→6) is also more efficient than the fixed number of channels. The first convolutional layer uses a filter of size 5×3. Through convolution, the model can extract local features, such as basic patterns or trends in the spectrum. The second convolutional layer can capture more complex patterns. The first max pooling layer Max Pool1 is used to reduce the size of the feature map in the convolutional layer while retaining important information. Through pooling, the model reduces the computational amount and increases the anti-noise ability of the model. The third convolutional layer can capture higher-level and more complex features. The fourth convolutional layer Conv4 continues to extract more complex features. The second max pooling layer Max Pool2 reduces the dimension of the feature map again to reduce the complexity and computational burden of the model while retaining sufficient information for subsequent classification or prediction tasks. Based on the spectrum temperature measurement model improved by CNN, first, through multi-layer convolution, compared with the traditional CNN model, it has more convolutional layers, can extract more detailed features and perform deeper learning, and is suitable for complex tasks in the accurate prediction of spectral data; second, through two pooling layers, it helps to further reduce the size of the feature map, making the model have stronger generalization ability and reducing the computational burden; third, the gradual increase of the convolutional layer filters: as the layer level increases, the size of the convolutional layer filters gradually increases, which helps the model to learn features from simple to complex. This design helps to capture a wider range of variations and patterns in the spectral data. In the spectrum temperature measurement model improved by CNN, the improved CNN can extract and process the structural features in the input data and detect patterns and objects in the image classification task. The magnitude of the temperature in the spectral measurement is encoded in its clear structural features, so the improved CNN has strong application value in magnetic field prediction.
[0023] S3. After training the spectrum temperature measurement model improved based on CNN with the training data set in step S1, a trained CNN model is obtained.
[0024] S4. After obtaining the spectral data to be measured of the object to be measured by the spectral acquisition device, input the spectral data to be measured into the trained CNN model to obtain the detected temperature value.
[0025] This spectrum temperature measurement method based on deep learning combines NV color centers with deep learning to achieve temperature prediction, can achieve efficient feature extraction, wide temperature adaptability, can measure the temperature by spectrum, can achieve a temperature error of about ±0.6°, and the optical path structure is simplified, can reduce the difficulty of temperature measurement, and has the advantage of high-precision measurement.
[0026] In steps S1 and S4, such asFigure 2 and Figure 3 The spectral acquisition device includes a laser generator 1, a reflecting mirror 2, a dichroic mirror 3, a first objective lens 4, a second objective lens 5, a spectrometer 6, an optical fiber coupler 7, an optical fiber 10, a tapered optical fiber 11 provided at the end of the optical fiber 10, and a diamond 12 with NV color centers provided at the end of the tapered optical fiber 11. The diamond 12 with NV color centers is placed within a range less than a set distance, such as 10 micrometers, from the object to be measured 8. The laser generator 1 generates a laser, which is adjusted by the reflecting mirror 2 and then reflected by the dichroic mirror 3 to the second objective lens 5 and coupled to the optical fiber coupler 7. The laser that is coupled into the optical fiber 10 excites the diamond NV color center crystal to generate an energy level transition, and when the energy level drops, it radiates red fluorescence outward; this process is the laser pumping effect of the optical path.
[0027] The red fluorescence generated by the diamond NV color center crystal radiates in all directions. Since the wavelength of the red fluorescence is higher than the wavelength of the dichroic mirror 3, such as 600 nm, the red fluorescence passes through the dichroic mirror 3 and enters the first objective lens 4. After being coupled by the first objective lens, the fluorescence is focused into the spectrometer 6, and the spectrometer 6 performs signal analysis, numerical calculation, fitting, and obtains the fluorescence wavelength. A long-pass filter 9 needs to be installed outside the photosensitive area of the spectrometer 6 to filter out stray light outside the entire optical path system, thereby improving the signal-to-noise ratio of the fluorescence signal.
[0028] This spectral temperature measurement method based on deep learning uses the end of the tapered optical fiber 11 to integrate a micron-scale diamond NV color center crystal to emit fluorescence. When the object to be measured 8 is a solid, during temperature measurement, the diamond 12 with NV color centers is placed within a range less than the set distance from the object to be measured 8; when the object to be measured 8 is a liquid, such as oil, during temperature measurement, after the glass tube is placed in the oil for more than a set time, such as 10 minutes, to make the temperature of the glass tube the same as that of the oil, the diamond 12 with NV color centers is placed in the glass tube for measurement. Since directly placing the NV color center in the oil will cause light refraction, the glass tube is used for encapsulation so that the NV color center does not come into contact with the oil.
[0029] The incident laser of the reflecting mirror 2 forms a 90° angle with the emitted laser, the incident laser of the dichroic mirror 3 forms a 90° angle with the laser reflected by the dichroic mirror 3 to the second objective lens 5, and the dichroic mirror 3 forms a 45° angle with the emitted laser of the laser emitter. The dichroic mirror 3 can reflect all light rays below a specific wavelength, and its function is equivalent to a reflecting mirror 2. The laser pumping process of the optical path can use a power meter to detect the power of the output laser, and the output laser with a suitable power can be set by adjusting the reflecting mirror 2. The laser generator 1 uses an adjustable laser generator 1. The laser generator 1 supports an external modulation function and can achieve pulsed laser by applying external pulse signal modulation. The laser generator 1 generates a green laser with a wavelength of 532 nm, and the laser pulse width ranges from 2 ns to 10 ms.
[0030] The present invention uses CNN to automatically learn local and global features in the spectrum, enabling efficient feature extraction, and can predict the temperature size without directly measuring the temperature. It does not rely on direct temperature measurement, but uses machine learning methods to predict the temperature size.
[0031] This spectrum temperature measurement method based on deep learning is the first to achieve waveguide-free spectrum temperature measurement and realizes temperature prediction through the combination of NV color centers and deep learning. It shows stability in the range of 30°C to 90°C, covering the temperature ranges commonly used in biomedicine and industry.
[0032] The experimental verification of this spectrum temperature measurement method based on deep learning in the embodiment is as follows: Setting the temperature range for data collection: covering 30°C to 90°C, setting the temperature gradient at intervals of 5°C (a total of 13 temperature points) to ensure data continuity and uniform distribution.
[0033] The spectrometer 6 uses a high-resolution spectrometer 6 (wavelength range 400~1000nm), and is equipped with a CMOS detector to collect spectral signals. Scene diversity: Simulating different environmental conditions (such as humidity changes, vibration interference); collecting spectral data of different materials (such as liquids, solids) to enhance the generalization ability of the model.
[0034] Input layer: The shape of the spectral data is (fluorescence wavelength, 1), and the example input size is (600, 1) (corresponding to 400~1000nm, 1nm resolution).
[0035] The training dataset is divided into a training set, a validation set, and a test set at 70%, 15%, and 15%. The training and optimization of the spectrum temperature measurement model based on the improved CNN are as follows: 1) Error index calculation: Root mean square error (RMSE): The RMSE of the test set is ±0.8°C; Mean absolute error (MAE): The MAE of the test set is ±0.6°C; 2) Temperature interval accuracy: 30~50°C: RMSE ±0.5°C; 50~70°C: RMSE ±0.7°C; 70~90°C: RMSE ±1.0°C.
[0036] Show the original spectrum and the model-predicted spectrum (after inverse normalization) at 30°C - 90°C, and the spectral curves are compared as Figure 5 as Figure 5 It can be seen from the results that the method of the embodiment can achieve high-precision temperature prediction.
[0037] Aiming at the complex implementation in temperature measurement for the traditional method of measuring temperature using ODMR spectrum, the present invention constructs a magnetic field quantum precision measurement system, establishes a spectral temperature measurement prediction model based on deep learning and the diamond NV color center quantum system, and solves the problems in the field of traditional temperature measurement using ODMR.
[0038] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A spectral temperature measurement method based on deep learning, characterized in that: It includes the following steps: S1. Obtain the spectral data of the object to be measured at different temperatures within a set temperature range by a spectral acquisition device, and mark the actual temperature value corresponding to each spectrum to form a training data set. S2. Construct a spectral temperature measurement model based on an improved CNN. The spectral temperature measurement model based on the improved CNN includes an input layer, a first convolutional layer, a second convolutional layer, a first max pooling layer, a third convolutional layer, a fourth convolutional layer, a second max pooling layer, a flattening layer, and a fully connected layer. After the input spectral data passes through the input layer, the first convolutional layer, the second convolutional layer, the first max pooling layer, the third convolutional layer, the fourth convolutional layer, the second max pooling layer, and the fully connected layer in sequence, the temperature value corresponding to the spectrum is obtained. S3. After training the spectral temperature measurement model based on the improved CNN using the training data set in step S1, a trained CNN model is obtained. S4. After obtaining the spectral data to be measured of the object to be measured by the spectral acquisition device, input the spectral data to be measured into the trained CNN model to obtain a detected temperature value.
2. The spectral temperature measurement method based on deep learning according to claim 1, wherein: In step S1, the spectral acquisition device obtains the spectral data of the object to be measured at different temperatures with a temperature gradient set at set temperature intervals within a set temperature range.
3. The spectral temperature measurement method based on deep learning according to claim 1, wherein: In step S2, in the spectral temperature measurement model based on the improved CNN, Input layer: Input the spectral data into the first convolutional layer. First convolutional layer Conv1: Perform a convolution operation using a filter with a size of 5×3 and output the first feature map to the second convolutional layer Conv2. Second convolutional layer Conv2: Extract more advanced features from the input feature map using a filter with a size of 7×4 and output the second feature map to the first max pooling layer Max Pool1. First max pooling layer Max Pool1: Perform a max pooling operation on the second feature map for dimensionality reduction and output it to the third convolutional layer Conv3. Third convolutional layer Conv3: Perform a convolution operation using a filter with a size of 9×5 to further extract features and output it to the fourth convolutional layer Conv4. Fourth convolutional layer Conv4: Perform a convolution operation using a filter with a size of 11×6 and output it to the second max pooling layer Max Pool2. Second max pooling layer Max Pool2: Perform a max pooling operation for dimensionality reduction and output it to the flattening layer Flatten. Flattening layer Flatten: Flatten it into a long vector and output it to the fully connected layer Fully Connected. Fully connected layer Fully Connected: Perform final feature combination and prediction to obtain a prediction result. Output layer: Output the prediction result obtained from the fully connected layer Fully Connected.
4. The spectral temperature measurement method based on deep learning according to any one of claims 1-3, characterized in that: In step S1, the fluorescence wavelength is used for the spectral data.
5. The spectral temperature measurement method based on deep learning according to any one of claims 1-3, characterized in that: In steps S1 and S4, the spectral acquisition device includes a laser generator, a reflector, a dichroic mirror, a first objective lens, a second objective lens, a spectrometer, an optical fiber coupler, an optical fiber, a tapered optical fiber provided at the end of the optical fiber, and a diamond with NV color centers provided at the end of the tapered optical fiber. Place a diamond with an NV center within a range less than the set distance from the object to be measured. The laser generator generates laser light, which is adjusted by a reflecting mirror and then reflected by a dichroic mirror to the second objective lens and coupled to a fiber optic coupler. The laser coupled into the fiber excites the diamond NV center crystal to produce an energy level transition, and when the energy level drops, red fluorescence is radiated outward. The red fluorescence generated by the diamond NV center crystal radiates in all directions. Since the wavelength of the red fluorescence is higher than that of the dichroic mirror, the red fluorescence passes through the dichroic mirror and enters the first objective lens. After being coupled by the first objective lens, the fluorescence is focused into a spectrometer, and the fluorescence wavelength is obtained by spectral analysis performed by the spectrometer.
6. The spectral temperature measurement method based on deep learning according to claim 5, wherein: The incident laser and the emitted laser of the reflecting mirror form a 90° angle. The incident laser of the dichroic mirror and the laser reflected by the dichroic mirror to the second objective lens form a 90° angle. The dichroic mirror and the emitted laser of the laser emitter form a 45° angle.
7. The spectroscopic temperature measurement method based on deep learning according to claim 5, characterized in that: The laser generator uses an adjustable laser generator.
8. The spectroscopic temperature measurement method based on deep learning according to claim 5, wherein: The laser generator generates green laser light with a wavelength of 532 nm, and the laser pulse width ranges between 2 ns and 10 ms.
9. The spectral temperature measurement method based on deep learning according to claim 5, characterized in that: The second objective lens and the spectrometer are equipped with long-pass filters for filtering out stray light.