Infrared image temperature measurement error correction method based on Lasso regularization regression model

Through the infrared image temperature measurement error correction method based on Lasso regularization regression model, the measurement error problem of infrared temperature measurement system under nonlinear factors is solved, and high-precision and stable temperature measurement are achieved, which is suitable for security monitoring, military reconnaissance and environmental monitoring.

CN120293328APending Publication Date: 2025-07-11ZHUHAI JINRUI ELECTRIC POWER TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510383825.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The existing infrared temperature measurement system has large measurement errors under different temperature measurement distances, focal lengths and ambient temperature changes. The traditional linear regression and empirical correction methods cannot accurately capture the nonlinear relationship, resulting in insufficient temperature measurement accuracy.

Method used

Using the Lasso regularization regression model, a multivariate nonlinear regression model is constructed, and data processing and model training is performed using Pandas and Scikit-learn frameworks. Combined with Python programming, interval sampling division method and Lasso regularization technology are used to establish an error correction model for infrared temperature measurement cameras of different focal lengths and models, and the temperature compensation value is calculated for correction.

Benefits of technology

It improves the accuracy and robustness of the infrared temperature measurement system, can accurately correct errors under different temperature measurement distances, focal lengths and ambient temperature changes, enhances the generalization ability of the model, avoids overfitting problems, and is suitable for diverse equipment and environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120293328A_ABST
    Figure CN120293328A_ABST
Patent Text Reader

Abstract

The invention provides an infrared image temperature measurement error correction method based on a Lasso regularization regression model, and the method comprises the steps: obtaining an infrared temperature measurement error correction data set, and dividing the data set into a training set and a test set; a Lasso regularized multivariate nonlinear regression model is constructed, the training set is used for training the multivariate nonlinear regression model, and the fitting effect of the trained model is evaluated through the test set; the method comprises the following steps: aiming at infrared temperature measurement cameras with different focal lengths, respectively establishing temperature measurement error correction models corresponding to the focal lengths based on the influence of focal length changes on nonlinear characteristics of temperature measurement errors; for infrared temperature measurement cameras with the same focal length but different models, test data of the cameras are adopted to carry out generalization ability verification on the model, and a temperature compensation value is calculated according to a verification error so as to realize correction of a temperature measurement error. According to the invention, various influence factors can be fully utilized, and temperature measurement errors under different conditions can be accurately corrected, so that the overall precision of the infrared temperature measurement system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of infrared temperature measurement, and particularly to an infrared image temperature measurement error correction method based on the Lasso regularization regression model. This method can effectively improve the measurement accuracy of the infrared temperature measurement system and is widely used in fields such as security monitoring, military reconnaissance, and environmental monitoring. Especially in scenarios where high requirements for infrared image temperature measurement are required and the measurement environment is complex, it can provide more accurate temperature data. Background Art

[0002] Infrared temperature measurement technology has been widely used in many fields such as security monitoring, military reconnaissance, and environmental monitoring due to its significant advantages of non-contact and real-time measurement. In the field of security monitoring, infrared temperature measurement can monitor the body temperature of personnel in real time to assist in epidemic prevention and abnormal body temperature screening; in military reconnaissance, it can detect the temperature characteristics of target objects at a long distance to provide key intelligence for military operations; in environmental monitoring, it can monitor the temperature of large areas to assist in ecological research and disaster warning. Infrared image temperature measurement, as an important application form of infrared temperature measurement technology, is of great importance.

[0003] However, in the actual application process of the infrared temperature measurement system, the problem of insufficient temperature measurement accuracy is relatively prominent. Especially in scenarios where different temperature measurement distances, different focal lengths, and different models of cameras are used, the measurement error often increases significantly with the change of these variables. Specifically, the temperature measurement error is not only affected by the temperature measurement distance, but also closely related to factors such as the focal length of the infrared camera and the environmental temperature. For example, when the temperature measurement distance changes, the attenuation degree of infrared radiation during propagation is different, resulting in a change in the received signal strength, which in turn affects the temperature measurement accuracy; cameras with different focal lengths have different optical imaging characteristics and different focusing effects on infrared radiation, which will also cause temperature measurement errors; the change of environmental temperature will interfere with the measurement of infrared radiation, making the measurement result deviate from the true temperature.

[0004] Currently, traditional infrared temperature measurement error correction methods mainly rely on simple linear regression or empirical correction formulas. The simple linear regression method assumes a linear relationship between the temperature measurement error and the influencing factors, and corrects the error by fitting a linear equation. The empirical correction formula is obtained based on a large amount of experimental data and experience, and has a certain correction effect on specific scenarios and conditions. However, these methods have obvious limitations. In fact, there is a complex non-linear relationship between the temperature measurement error and multiple factors, and traditional linear regression and empirical correction formulas often cannot accurately capture this non-linear feature. Therefore, in multi-variable scenarios, especially between infrared cameras with different focal lengths and different models, traditional methods cannot achieve effective unified correction, resulting in a still large temperature measurement error and being difficult to meet the requirements of high-precision measurement.

[0005] To overcome the deficiencies of traditional methods, more and more studies have begun to attempt to introduce advanced machine learning techniques, such as support vector machines, neural networks, etc., to correct infrared temperature measurement errors. Support vector machines divide different categories of data by finding the optimal hyperplane and have certain advantages in dealing with nonlinear problems; neural networks can automatically learn complex patterns and features in data by simulating the structure and function of human brain neurons. However, these methods also face some problems in practical applications. On the one hand, they often require a large amount of data for training, and the cost of data acquisition and annotation is relatively high; on the other hand, these methods are easily affected by overfitting, that is, they perform well on the training data but their performance drops significantly on new test data.

[0006] As a regression method that can perform feature selection and regularization, Lasso regression has been widely used in dealing with high-dimensional data and nonlinear regression problems in recent years. By introducing the L1 regularization term, it can automatically select important feature variables, reduce the complexity of the model, and thus effectively avoid the overfitting problem. At the same time, Lasso regression also has a certain ability to handle nonlinear relationships. Through reasonable feature engineering and model construction, it can better fit the complex relationship between temperature measurement errors and multiple factors. Therefore, applying Lasso regression to infrared temperature measurement error correction has good application potential, is expected to solve the problems existing in the prior art, and improve the accuracy and reliability of infrared temperature measurement. Summary of the Invention

[0007] In order to overcome the shortcomings and deficiencies of the prior art, the purpose of the present invention is to provide an infrared image temperature measurement error correction method based on the Lasso regularization regression model, which can make full use of various influencing factors to accurately correct the temperature measurement errors under different conditions, thereby improving the overall accuracy of the infrared temperature measurement system.

[0008] The present invention achieves the above purpose through the following technical solutions:

[0009] An infrared image temperature measurement error correction method based on the Lasso regularization regression model, comprising the following steps:

[0010] Obtain an infrared temperature measurement error correction data set, and divide the data set into a training set and a test set;

[0011] Construct a multivariate nonlinear regression model with Lasso regularization, use the training set to train the multivariate nonlinear regression model, and evaluate the fitting effect of the trained model through the test set;

[0012] For infrared temperature measurement cameras with different focal lengths, based on the influence of focal length changes on the nonlinear characteristics of temperature measurement errors, establish temperature measurement error correction models corresponding to each focal length respectively;

[0013] For infrared temperature measurement cameras with the same focal length but different models, the test data of the corresponding model are used to verify the generalization ability of the error correction model, and the temperature compensation value is calculated according to the verification error to correct the temperature measurement error.

[0014] According to an infrared image temperature measurement error correction method based on the Lasso regularization regression model provided by the present invention, in the process of obtaining the infrared temperature measurement error correction data set, processing the data set, constructing the model and programming experiments, the following steps are specifically included:

[0015] Use the Pandas data frame technology to store, clean, transform and extract features from the data set, so as to organize the data set into a format suitable for model training;

[0016] Use the Scikit-learn machine learning framework to construct a multiple non-linear regression model with Lasso regularization, and use the functions and tools provided by the framework to realize the initialization, training, parameter tuning and performance evaluation of the model;

[0017] Combine with the Python language for programming experiments, write Python code to realize the division of the data set, the construction and training of the model, the processing of models corresponding to cameras with different focal lengths and models, and the calculation of the temperature compensation value, and execute the code through the Python running environment to complete the entire infrared image temperature measurement error correction process.

[0018] According to an infrared image temperature measurement error correction method based on the Lasso regularization regression model provided by the present invention, when constructing a multiple non-linear regression model with Lasso regularization, the independent variables of the model are selected, and the independent variables include the temperature to be corrected, the temperature measurement distance, and the ambient temperature, and the dependent variable is the corrected temperature;

[0019] Use the interval sampling division method to divide the data set, so that the temperature points and distance points in the divided training set and test set do not overlap with each other, so as to evaluate the ability of the model to correct errors at unseen temperature points and distance points.

[0020] According to an infrared image temperature measurement error correction method based on the Lasso regularization regression model provided by the present invention, for infrared temperature measurement cameras with different focal lengths, multiple non-linear regression models with Lasso regularization are constructed respectively;

[0021] In the process of constructing the multiple non-linear regression model with Lasso regularization corresponding to each focal length, use the hyperparameter optimization method to determine the optimal penalty coefficient in the Lasso regularization, use the model with the smallest maximum absolute error as the optimal model, and use the test set to evaluate the fitting effect of the optimal model.

[0022] According to an infrared image temperature measurement error correction method based on the Lasso regularization regression model provided by the present invention, the construction of the Lasso-regularized multivariate nonlinear regression model specifically includes:

[0023] For infrared temperature measurement cameras with different focal lengths, a quadratic polynomial regression model is established respectively, expressed by the following formula:

[0024]

[0025] Wherein, is the temperature after correction of the infrared temperature measurement camera with focal length f, is the regression coefficient, is the temperature to be corrected, d f is the temperature measurement distance, is the ambient temperature.

[0026] According to an infrared image temperature measurement error correction method based on the Lasso regularization regression model provided by the present invention, the Lasso regularization method is adopted, the L1 regularization term is introduced, and the regression coefficients of some irrelevant variables are compressed to 0. The model formula constrained by Lasso is:

[0027]

[0028] Wherein, λ f is the Lasso regularization penalty coefficient corresponding to the camera with focal length f, which determines the degree of coefficient shrinkage, and ||·||1 is the first-order norm function.

[0029] According to an infrared image temperature measurement error correction method based on the Lasso regularization regression model provided by the present invention, when determining the optimal model, the training set is input into the model, and grid search is used for hyperparameter optimization. The search range is set as 0 ≤ λ f ≤ 1, with an interval of 0.1, and finally the model with the smallest maximum absolute error is selected as the optimal model.

[0030] According to an infrared image temperature measurement error correction method based on the Lasso regularization regression model provided by the present invention, the establishment of the temperature measurement error correction model corresponding to each focal length includes:

[0031] For each infrared temperature measurement camera with a specific focal length, a large amount of infrared temperature measurement data including the temperature to be corrected, the temperature measurement distance, the ambient temperature, and the actually corrected temperature at this focal length is collected to form the initial data set corresponding to this focal length;

[0032] Analyze the influence law of focal length change on the non-linear characteristics of temperature measurement error at this focal length, and extract the key characteristic variables that can reflect this non-linear characteristic; use the extracted key characteristic variables as independent variables and the actually corrected temperature as the dependent variable, and construct a multiple non-linear regression model with Lasso regularization using the initial data set corresponding to this focal length;

[0033] During the model construction process, adopt a hyperparameter optimization method to determine the optimal penalty coefficient in Lasso regularization, and use the model with the smallest maximum absolute error as the optimal temperature measurement error correction model at this focal length;

[0034] Evaluate the fitting effect of the optimal temperature measurement error correction model through the test set. If the evaluation result meets the preset accuracy requirements, it is determined that the temperature measurement error correction model corresponding to this focal length is established; if not, adjust the characteristic variables or optimize the model parameters, and reconstruct and evaluate the model until the accuracy requirements are met.

[0035] According to an infrared image temperature measurement error correction method based on the Lasso regularization regression model provided by the present invention, for a certain model of infrared temperature measurement camera to be verified under the same focal length, use this model of camera to collect test data including the temperature to be corrected, the temperature measurement distance, the ambient temperature, and the actually corrected temperature, and form a test data set of this model;

[0036] Input the temperature to be corrected, the temperature measurement distance, the ambient temperature, etc. in the test data set into the established error correction model corresponding to this focal length, and obtain the corrected temperature predicted by the model;

[0037] Calculate the error between the corrected temperature predicted by the model and the actually corrected temperature in this test data set, and this error is the verification error;

[0038] Calculate the temperature compensation value according to the verification error. If the verification error is the difference between the model prediction value and the actual value, the temperature compensation value is the opposite of this difference. By adding this temperature compensation value to the original temperature measurement result of this model of camera, the correction of the temperature measurement error is realized.

[0039] According to an infrared image temperature measurement error correction method based on the Lasso regularization regression model provided by the present invention, if the verification error is within the preset allowable range, it indicates that this error correction model has good generalization ability for this model of camera, and the temperature compensation method can be directly used for temperature measurement error correction; if the verification error exceeds the preset allowable range, analyze the cause of the error, adjust and optimize the error correction model, at least including adding characteristic variables specific to this model of camera, adjusting model parameters, etc., and then re-perform the generalization ability verification and temperature compensation value calculation until the verification error is within the allowable range.

[0040] It can be seen that, compared with the prior art, the method provided by the present invention has the following beneficial effects:

[0041] 1. Through the multivariate non-linear regression model based on Lasso regularization, the present invention can more accurately correct the infrared temperature measurement error, especially under different temperature measurement distances, different focal lengths, and environmental temperature changes. Compared with traditional linear regression or empirical correction methods, Lasso regression can effectively capture complex non-linear relationships, reduce the temperature measurement error caused by distance changes and focal length differences, thereby improving the accuracy of infrared image temperature measurement.

[0042] 2. The present invention adopts the interval sampling division method and Lasso regularization technology to ensure that the model can be effectively corrected at unseen temperature points and temperature measurement distances. Especially for infrared temperature measurement cameras of different models and different focal lengths, the model can be corrected among multiple cameras with the same focal length, enhancing the generalization ability of the model in practical applications. Compared with traditional methods, it can maintain high correction performance in diverse devices and environments.

[0043] 3. By using Lasso regularization technology, the present invention can effectively constrain the regression model, avoid the overfitting problem of the model under high-dimensional data, thereby improving the stability and robustness of the model. In traditional regression methods, especially in the case of complex data, overfitting is likely to occur. However, through regularization adjustment, the present invention ensures that the performance of the model in the training set and the test set is more consistent, with stronger practical application value.

[0044] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Description of the Drawings

[0045] Figure 1 is a flowchart of an embodiment of an infrared image temperature measurement error correction method based on a Lasso regularization regression model of the present invention.

[0046] Figure 2 is a schematic diagram of the error result of the model corresponding to a focal length of 9.1 mm in the training set in an embodiment of an infrared image temperature measurement error correction method based on a Lasso regularization regression model of the present invention.

[0047] Figure 3 is a schematic diagram of the error result of the model corresponding to a focal length of 9.1 mm in the test set in an embodiment of an infrared image temperature measurement error correction method based on a Lasso regularization regression model of the present invention.

[0048] Figure 4It is a schematic diagram of the error results of the model corresponding to a focal length of 13mm in the training set in an embodiment of an infrared image temperature measurement error correction method based on the Lasso regularization regression model of the present invention.

[0049] Figure 5 It is a schematic diagram of the error results of the model corresponding to a focal length of 13mm in the test set in an embodiment of an infrared image temperature measurement error correction method based on the Lasso regularization regression model of the present invention.

[0050] Figure 6 It is a schematic diagram of the comparison of temperature measurement accuracy before and after adding the temperature compensation coefficient in an embodiment of an infrared image temperature measurement error correction method based on the Lasso regularization regression model of the present invention.

[0051] Figure 7 It is a schematic diagram of the temperature measurement accuracy results of all models in an embodiment of an infrared image temperature measurement error correction method based on the Lasso regularization regression model of the present invention. Detailed implementation manners

[0052] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without making creative efforts based on the embodiments in the present invention belong to the scope of protection of the present invention.

[0053] Referring to

[0054] See Figures 1 to 7 , the present invention provides an infrared image temperature measurement error correction method based on the Lasso regularization regression model, and the method includes the following steps:

[0055] Step S1, obtain an infrared temperature measurement error correction data set, and divide the data set into a training set and a test set;

[0056] Step S2, construct a multivariate non-linear regression model with Lasso regularization, use the training set to train the multivariate non-linear regression model, and evaluate the fitting effect of the trained model through the test set;

[0057] Step S3: For infrared thermographic cameras with different focal lengths, based on the influence of focal length changes on the non-linear characteristics of temperature measurement errors, establish temperature measurement error correction models corresponding to each focal length respectively;

[0058] Step S4: For infrared thermographic cameras with the same focal length but different models, use the test data of this model camera to verify the generalization ability of the error correction model, and calculate the temperature compensation value according to the verification error to correct the temperature measurement error.

[0059] In the above Step S1, during the process of obtaining the infrared temperature measurement error correction data set, processing the data set, constructing the model and programming the experiment, the following steps are specifically included:

[0060] Use the Pandas data frame technology to store, clean, transform and extract features from the data set, so as to organize the data set into a format suitable for model training;

[0061] Use the Scikit-learn machine learning framework to construct a multivariate non-linear regression model with Lasso regularization, and use the functions and tools provided by this framework to realize the initialization, training, parameter tuning and performance evaluation of the model;

[0062] Combine with Python language for programming experiments, write Python code to realize the division of the data set, the construction and training of the model, the processing of models corresponding to cameras with different focal lengths and models, and the calculation of temperature compensation values, and execute the code through the Python running environment to complete the entire infrared image temperature measurement error correction process.

[0063] In practical applications, first, select the temperature to be corrected, the temperature measurement distance, and the ambient temperature as the independent variables of the model, and the corrected temperature as the dependent variable. Set the values of the temperature measurement distance to 5, 7.5, 10, 15, 20, 22.5, 25, and 30 meters as the distance points of the model. Select the temperature of the surface source blackbody furnace as the corrected temperature, and set the temperature points to 30°C, 40°C, 50°C, 60°C, 70°C, 80°C, 90°C, and 100°C, with an interval of 10°C.

[0064] At each distance point and temperature point, use the infrared thermographic camera to take four pictures and record the current ambient temperature. Take the average value of the highest temperatures in the four pictures as a sample data under this condition. Each sample contains independent variables (temperature to be corrected, temperature measurement distance, ambient temperature) and a dependent variable (corrected temperature).

[0065] Then, the dataset is divided using the interval sampling division method. Distance points between 5 and 30 meters with an interval of 5 meters (including 5 meters, 10 meters, 15 meters, 20 meters, 25 meters, 30 meters), and temperature points between 40°C and 100°C with an interval of 20°C (including 40°C, 60°C, 80°C, 100°C) are selected as the training set, with a total of 24 samples. Three distance points, 7.5 meters, 15 meters, and 22.5 meters, and temperature points in the range of 30°C to 90°C with an interval of 20°C (including 30°C, 50°C, 70°C, 90°C) are selected as the test set, with a total of 12 samples.

[0066] The temperature points and distance points of the split training set and test set do not overlap with each other to evaluate whether the model can perform error correction on unseen temperature points and distance points. The specific division method is as follows:

[0067] 1) The training set includes: six distance points of 5 meters, 10 meters, 15 meters, 20 meters, 25 meters, and 30 meters, and four temperature points of 40°C, 60°C, 80°C, and 100°C, for a total of 24 samples.

[0068] 2) The test set includes: three distance points of 7.5 meters, 15 meters, and 22.5 meters, and four temperature points of 30°C, 50°C, 70°C, and 90°C, for a total of 12 samples.

[0069] The collected data is processed using the Pandas library, and the data is organized into a format that the model can input for subsequent modeling.

[0070] In the above step S2, the multiple non - linear regression model estimates the coefficients of each feature variable by the least - squares method to minimize the loss function, thus achieving the best fit. This model uses the optimal combination of multiple independent variables to predict the dependent variable, and while ensuring computational feasibility, it can obtain a temperature measurement error correction result that is more in line with reality.

[0071] Therefore, when constructing the Lasso - regularized multiple non - linear regression model, the independent variables of the model are selected. The independent variables include the temperature to be corrected, the temperature measurement distance, and the ambient temperature, and the dependent variable is the corrected temperature; and the interval sampling division method is used to divide the dataset so that the temperature points and distance points in the divided training set and test set do not overlap with each other, thereby evaluating the ability of the model to perform error correction on unseen temperature points and distance points. In the process of constructing the Lasso - regularized multiple non - linear regression model corresponding to each focal length, the hyperparameter optimization method is used to determine the optimal penalty coefficient in Lasso regularization, and the model with the smallest maximum absolute error is used as the optimal model, and the fitting effect of the optimal model is evaluated using the test set.

[0072] Specifically, in this embodiment, the temperature to be corrected, the temperature measurement distance, and the ambient temperature are selected as independent variables, and the corrected temperature is used as the dependent variable. For infrared temperature measurement cameras with different focal lengths, a quadratic polynomial regression model is established respectively, and the formula is as follows:

[0073]

[0074] Among them, is the temperature after correction of the infrared temperature measurement camera with focal length f, is the regression coefficient, is the temperature to be corrected, d f is the temperature measurement distance, is the ambient temperature.

[0075] Since there may be a problem of multicollinearity among the independent variables, the traditional least squares method may lead to overfitting of the model and affect the generalization ability. In this embodiment, the Lasso (Least Absolute Shrinkage and Selection Operator) regularization method is adopted, the L1 regularization term is introduced, and the regression coefficients of some irrelevant variables are compressed to 0, so as to reduce the influence of redundant variables and improve the stability and interpretability of the model. The model formula constrained by Lasso is as follows:

[0076]

[0077] Among them, λ f is the Lasso regularization penalty coefficient corresponding to the camera with focal length f, which determines the degree of shrinkage of the coefficient, and ||·||1 is the first-order norm function.

[0078] The training set is input into the model, and hyperparameter optimization is carried out by using grid search. The search range is set as 0 ≤ λ f ≤ 1, and the interval is 0.1. Taking the infrared temperature measurement camera CW9101 with a focal length of 9.1 mm as an example, the grid search results are shown in Table 1. Table 1 is the grid search result of the penalty coefficient of the model corresponding to a focal length of 9.1 mm. Finally, the model with the smallest maximum absolute error is selected as the optimal model, and λ f = 0.4 is determined.

[0079] (1)

[0081] The formula of the optimal model is as follows:

[0082]

[0083] The error of the model in the training set is as Figure 2As shown, it can be seen that the temperature to be corrected is significantly lower than the true temperature as the temperature measurement distance increases, indicating that there is a systematic deviation in the original temperature measurement value (the temperature measurement decays as the distance increases). The corrected temperature closely follows the true temperature, and the model has successfully corrected the temperature measurement error, making the corrected temperature closer to the true temperature.

[0084] After correction, most of the temperature errors are within ±1°C, and the error is significantly reduced. The absolute error before correction was relatively large, reaching a maximum of 22.5°C. The maximum absolute error after correction is 1.03°C, showing a significant improvement compared to the error of the original data. From different temperature regions, the distribution of the error is also relatively uniform, without the phenomenon of being particularly large or small in one temperature region.

[0085] Generally speaking, the error before correction is overall negative, indicating that the temperature measurement results are generally lower than the true values (systematic error). After Lasso regularization multiple non - linear regression correction, the temperature error tends to 0, and the correction curve fits the true temperature better. This shows that the model effectively corrects the infrared temperature measurement error, enabling the corrected temperature to maintain good accuracy at different distances.

[0086] The error of the model in the test set is as Figure 3 shown. It can be seen that the corrected temperature basically approaches the true temperature, indicating that the model can still perform well in correcting the temperature error on the test set. The error range has increased relatively compared to the training set, indicating that the performance of the model on unseen data has slightly declined, but the overall error still remains within the range of ±1.03°C, which is still an acceptable correction effect in most application scenarios.

[0087] The error of the test set is slightly higher. The mean absolute error has increased from 0.41°C in the training set to 0.88°C, and the maximum absolute error has increased from 1.03°C in the training set to 1.75°C, but it is still less than the ±3.0°C error of the infrared temperature measurement camera detector.

[0088] Overall, the model has successfully corrected the temperature measurement error, making the corrected temperature closer to the true temperature, still maintaining a good correction effect on unseen data, and having good generalization ability.

[0089] In the above step S3, establishing a temperature measurement error correction model corresponding to each focal length includes:

[0090] For each infrared temperature measurement camera with a specific focal length, collect a large amount of infrared temperature measurement data including the temperature to be corrected, the temperature measurement distance, the ambient temperature, and the actual corrected temperature at this focal length, forming an initial data set corresponding to this focal length;

[0091] Analyze the influence law of focal length change on the non - linear characteristics of temperature measurement error at this focal length, and extract the key characteristic variables that can reflect this non - linear characteristic; use the extracted key characteristic variables as independent variables and the actually corrected temperature as the dependent variable, and construct a multiple non - linear regression model with Lasso regularization using the initial data set corresponding to this focal length.

[0092] In the process of constructing the model, adopt the hyperparameter optimization method to determine the optimal penalty coefficient in Lasso regularization, and use the model with the smallest maximum absolute error as the optimal temperature measurement error correction model at this focal length.

[0093] Evaluate the fitting effect of the optimal temperature measurement error correction model through the test set. If the evaluation result meets the preset accuracy requirements, it is determined that the temperature measurement error correction model corresponding to this focal length is established; if not, adjust the characteristic variables or optimize the model parameters, and re - construct and evaluate the model until the accuracy requirements are met.

[0094] In practical applications, for infrared temperature measurement cameras with different focal lengths, due to the influence of focal length change on the non - linear characteristics of temperature measurement error, independent temperature measurement error correction models are established respectively.

[0095] For infrared temperature measurement cameras with different focal lengths, use the multiple non - linear regression model with Lasso regularization for error correction. The following are the correction models for cameras with different focal lengths:

[0096] For the infrared temperature measurement camera CW9101 with a focal length of 9.1 mm, its error correction model has been established in step 2 above, and the formula is as follows:

[0097]

[0098] For the infrared temperature measurement camera CW1301 with a focal length of 13 mm, similarly establish a quadratic polynomial regression model with Lasso constraint, and the formula is as follows:

[0099]

[0100] Input the corresponding training set into the model, and use grid search for hyperparameter optimization. The search range is set as 0 ≤ λ f ≤ 1, with an interval of 0.1. The search results are shown in Table 2. Table 2 is the grid search result of the penalty coefficient of the model corresponding to a focal length of 13 mm. Select the model with the smallest maximum absolute error as the optimal model, and determine that λ f = 0.4.

[0101]

[0102] (2)

[0104] The formula for the optimal model is as follows:

[0105]

[0106] The error of the model in the training set is as Figure 4 shown. The temperature error before correction is relatively large, up to 18.7°C at most, and the error increases with the increase of the temperature measurement distance. After correction, most of the temperature errors are controlled within ±1°C, and the maximum absolute error is reduced to 1.87°C, indicating that the model has a good fitting effect on the training set.

[0107] The error of the model in the test set is as Figure 5 shown. The corrected temperature is basically close to the true temperature, and the error range is controlled within ±2.2°C, with an average error of 0.96°C. The maximum absolute error increases from 1.87°C in the training set to 2.20°C, but it is still less than the original temperature measurement error of ±3.0°C of the camera sensor. It can be seen that the generalization ability of the model is good, and it can still effectively correct errors on unseen data.

[0108] Next, in order to verify the generality of the model, error correction models with two focal lengths are compared, and the formulas are as follows:

[0109]

[0110] Judging from the formulas, the model structures are exactly the same, indicating that the method is general. Their differences only lie in the different coefficients of each item, indicating that the influence degrees of cameras with different focal lengths on temperature, distance, and ambient temperature are different.

[0111] Judging from Table 3, Table 3 shows the error comparison of models with different focal lengths on the dataset. The error performances of the two models with different focal lengths on the dataset are similar, and the average error of the test set only differs by 0.08°C. This indicates that the correction capabilities of the two models with different focal lengths on unseen data are basically the same, and both can achieve good fitting effects. In addition, judging from the change of the error from the training set to the test set, the average error of the model corresponding to the focal length of 9.1mm increases from 0.41°C to 0.88°C, an increase of 0.47°C, and the average error of the model corresponding to the focal length of 13mm increases from 0.59°C to 0.96°C, an increase of 0.37°C. It can be seen that the change amounts of the generalization errors of different focal lengths are close, indicating that the generalization abilities of the model at different focal lengths are similar.

[0112] (3)

[0114] Judging from the error curves Figure 2 and Figure 3 (9.1mm) and Figure 4 and Figure 5(13mm) It can be observed that the correction curves of the two focal lengths are similar in shape, and both have successfully corrected the temperature measurement error that decreases with the increase of distance. Moreover, it can be found in the temperature curve to be corrected that the error in the high-temperature region is slightly larger, while the error in the low-temperature region is smaller. This trend is consistent in the cameras with the two focal lengths. This indicates that the model can be applied to infrared cameras with different focal lengths, and only the regression coefficients need to be adjusted.

[0115] Therefore, the temperature measurement error correction method of this embodiment is applicable to infrared temperature measurement cameras with different focal lengths. Only by retraining based on the corresponding data can the regression coefficients applicable to this focal length be obtained, and accurate temperature measurement error correction can be achieved. This shows that this method can be used for various infrared temperature measurement devices with different specifications and has broad application value.

[0116] In the above step S4, for a certain model of infrared temperature measurement camera to be verified under the same focal length, use this model of camera to collect test data including the temperature to be corrected, the temperature measurement distance, the ambient temperature, and the actually corrected temperature, and form a test data set for this model.

[0117] Input the temperature to be corrected, the temperature measurement distance, the ambient temperature, etc. in the test data set into the established error correction model corresponding to this focal length, and obtain the corrected temperature predicted by the model.

[0118] Calculate the error between the corrected temperature predicted by the model and the actually corrected temperature in this test data set. This error is the verification error.

[0119] Calculate the temperature compensation value according to the verification error. If the verification error is the difference between the predicted value and the actual value of the model, then the temperature compensation value is the opposite of this difference. By adding this temperature compensation value to the original temperature measurement result of this model of camera, the correction of the temperature measurement error is realized.

[0120] If the verification error is within the preset allowable range, it indicates that the error correction model has good generalization ability for this model of camera, and the temperature compensation method can be directly used for temperature measurement error correction; if the verification error exceeds the preset allowable range, analyze the cause of the error, and adjust and optimize the error correction model, at least including adding feature variables specific to this model of camera, adjusting model parameters, etc., and then re-perform the generalization ability verification and temperature compensation value calculation until the verification error is within the allowable range.

[0121] In practical applications, for infrared temperature measurement cameras with the same focal length but different models, based on the error correction model with the corresponding focal length, use the test data of this model of camera to verify the generalization ability of the model, and calculate the temperature compensation according to the error.

[0122] For infrared thermographic cameras with the same focal length but different models, an error correction model with the corresponding focal length is used for temperature measurement correction, and the generalization ability of the model is verified. Taking three infrared thermographic cameras CW1301, CW1302, and CW1303 with a focal length of 13 mm as examples, the following error correction formula is used for all of them:

[0123]

[0124] To verify whether the error correction model can be applied to cameras with the same focal length but different models, the test data of the three cameras are input into the model, and the error after correction is calculated. It is found that:

[0125] 1) There are still systematic biases in the errors of cameras with different models on the test set, that is, the measured temperature values after correction still deviate from the true temperature.

[0126] 2) Due to differences in factors such as the sensor sensitivity, lens transmittance, and temperature measurement algorithm of cameras with different models, there may still be residual errors of different degrees even when using the same error correction model.

[0127] To further improve the temperature measurement accuracy, the temperature compensation method is adopted in this embodiment, and the specific steps are as follows:

[0128] 1) Calculate the average error of the model on the test data of the corresponding model camera.

[0129] 2) Take the opposite of the average error as the temperature compensation coefficient of the camera of this model. As shown in Table 4, Table 4 shows the error results of the correction model on the test data of cameras with the same focal length but different models.

[0130] 3) Add the temperature compensation coefficient to the correction model in the form of a constant term to make an additional adjustment to the temperature measurement result.

[0131]

[0132] (4)

[0134] The comparison of the temperature measurement accuracy before and after adding temperature compensation is as Figure 6 shown. It can be seen that after temperature compensation, the errors of the three models of cameras are significantly reduced. The average absolute error of CW1301 drops the most, and the correction effect is the best, from 1.88 °C to 0.38 °C, a reduction of 80%. The correction effect of CW1303 is relatively weak, but it still reduces the average absolute error from 2.10 °C to 0.92 °C, a reduction of 56%. The errors of the three models of cameras are all reduced by more than 50%.

[0135] Generally speaking, after temperature compensation, the temperature measurement errors of all models are significantly reduced, and the final temperature measurement errors are as shown in Figure 7 . After temperature compensation, the error distribution becomes more uniform, reducing the error accumulation with the increase of distance. This method not only reduces the global error, but also makes the error distribution more stable, making the temperature measurement results more reliable. During application, only by adjusting the compensation coefficient can good error correction be achieved.

[0136] In summary, through the multivariate nonlinear regression model based on Lasso regularization, the present invention can significantly improve the accuracy of infrared temperature measurement error correction. In practical applications, infrared temperature measurement errors are affected by multiple complex nonlinear factors such as temperature measurement distance, focal length, and ambient temperature. Traditional linear regression or experience-based correction methods cannot effectively capture these complex nonlinear relationships, resulting in poor correction effects and large temperature measurement errors under different temperature measurement distances, different focal lengths, and ambient temperature changes. The Lasso regularization multivariate nonlinear regression model of the present invention can deeply explore the nonlinear correlation between temperature measurement errors and multiple factors, more accurately fit the data, thereby effectively reducing the temperature measurement errors caused by distance changes and focal length differences, greatly improving the accuracy of infrared image temperature measurement, and meeting the requirements of high-precision measurement.

[0137] Furthermore, the present invention adopts the interval sampling division method and Lasso regularization technology to ensure that the model has excellent generalization ability. The interval sampling division method makes the temperature points and distance points in the training set and the test set non-overlapping, which enables the model to effectively correct errors at unseen temperature points and temperature measurement distances. Especially for infrared temperature measurement cameras of different models and different focal lengths, the present invention corrects between multiple cameras with the same focal length, enabling the model to adapt to the differences between different devices. Compared with traditional methods, the present invention can maintain high correction performance in diverse devices and environments. Whether between different models of infrared temperature measurement cameras or in different usage scenarios, accurate and reliable error correction can be achieved, enhancing the applicability and flexibility of the model in practical applications.

[0138] Furthermore, the present invention uses the Lasso regularization technique to effectively constrain the regression model, successfully avoiding the overfitting problem of the model in high-dimensional data. In traditional regression methods, when the data is complex and the feature dimension is high, the model is prone to overfitting the training data, resulting in poor performance in test data or actual applications. The Lasso regularization, by introducing the L1 regularization term, automatically selects important feature variables, reduces the complexity of the model, and makes the performance of the model in the training set and the test set more consistent. It not only improves the stability of the model and reduces the change of the model performance caused by data fluctuations, but also enhances the robustness of the model, enabling the model to better cope with various interferences and uncertainties in actual applications, and having stronger practical application value.

[0139] Furthermore, the technical solution of the present invention can effectively cope with the complex scenarios faced by the infrared temperature measurement technology in actual applications. In the field of security monitoring, it can accurately correct the temperature data collected by surveillance cameras with different distances and different focal lengths, improving the accuracy of personnel body temperature monitoring; in military reconnaissance, it can accurately obtain the temperature information of target objects, providing a reliable basis for military decision-making; in environmental monitoring, it can correct the temperature measurement results in large areas and under different environmental conditions, improving the accuracy and reliability of environmental monitoring. By improving the accuracy and stability of infrared temperature measurement, the present invention expands the application scope of the infrared temperature measurement technology and provides more powerful technical support for the development of various fields.

[0140] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0141] The above embodiments are only the preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantive changes and substitutions made by those skilled in the art based on the present invention belong to the scope required to be protected by the present invention.

Claims

1. An infrared image temperature measurement error correction method based on the Lasso regularization regression model, characterized in that It includes the following steps: Obtain an infrared temperature measurement error correction dataset, and divide the dataset into a training set and a test set; Construct a multivariate non-linear regression model with Lasso regularization, use the training set to train the multivariate non-linear regression model, and evaluate the fitting effect of the trained model through the test set; For infrared temperature measurement cameras with different focal lengths, based on the influence of focal length change on the non-linear characteristics of temperature measurement error, establish a temperature measurement error correction model corresponding to each focal length respectively; For infrared temperature measurement cameras with the same focal length but different models, use the test data of this model camera to verify the generalization ability of the error correction model, and calculate the temperature compensation value according to the verification error to achieve the correction of the temperature measurement error.

2. The method according to claim 1, characterized in that In the process of obtaining the infrared temperature measurement error correction dataset and processing the dataset, constructing models and programming experiments, it specifically includes the following steps: Use the Pandas data frame technology to store, clean, transform and extract features of the dataset, so as to organize the dataset into a format suitable for model training; Use the Scikit-learn machine learning framework to construct a multivariate non-linear regression model with Lasso regularization, and use the functions and tools provided by this framework to realize the initialization, training, parameter tuning and performance evaluation of the model; Combine the Python language to conduct programming experiments, write Python code to realize the division of the dataset, the construction and training of the model, the processing of models corresponding to cameras with different focal lengths and models, and the calculation of the temperature compensation value, and execute the code through the Python running environment to complete the entire infrared image temperature measurement error correction process.

3. The method according to claim 1, wherein: When constructing a multivariate non-linear regression model with Lasso regularization, select the independent variables of the model. The independent variables include the temperature to be corrected, the temperature measurement distance, and the ambient temperature, and the dependent variable is the corrected temperature; Use the interval sampling division method to divide the dataset, so that the temperature points and distance points in the divided training set and test set do not overlap with each other, so as to evaluate the ability of the model to correct errors at unseen temperature points and distance points.

4. The method according to claim 3, wherein: For infrared temperature measurement cameras with different focal lengths, respectively construct a multivariate non-linear regression model with Lasso regularization; In the process of constructing the Lasso-regularized multivariate non-linear regression model corresponding to each focal length, use the hyperparameter optimization method to determine the optimal penalty coefficient in Lasso regularization, use the model with the smallest maximum absolute error as the optimal model, and use the test set to evaluate the fitting effect of the optimal model.

5. The method according to claim 4, wherein The construction of the multivariate non-linear regression model with Lasso regularization specifically includes: For infrared temperature measurement cameras with different focal lengths, respectively establish a quadratic polynomial regression model, expressed as the following formula: Among them, is the temperature after calibration of the infrared thermographic camera with focal length f, β i f (i=0,1,...,9) are regression coefficients, is the temperature to be calibrated, d f is the temperature measurement distance, is the ambient temperature.

6. The method according to claim 5, wherein: Use the Lasso regularization method, introduce the L1 regularization term, compress the regression coefficients of some irrelevant variables to 0, and the model formula constrained by Lasso is: Among them, λ f is the Lasso regularization penalty coefficient corresponding to the focal length f of the camera, which determines the degree of shrinkage of the coefficient, and ||·||1 is the first-order norm function.

7. The method according to claim 6, wherein: When determining the optimal model, the training set is input into the model, and grid search is used for hyperparameter optimization. The search range is set as 0 ≤ λ f ≤ 1, with an interval of 0.

1. Finally, the model with the smallest maximum absolute error is selected as the optimal model.

8. The method according to any one of claims 1 to 7, characterized in that, The establishment of the temperature measurement error correction model corresponding to each focal length includes: For each infrared temperature measurement camera with a specific focal length, a large amount of infrared temperature measurement data including the temperature to be corrected, the temperature measurement distance, the ambient temperature, and the actually corrected temperature at this focal length is collected to form an initial data set corresponding to this focal length; Analyze the influence law of the focal length change on the non-linear characteristics of the temperature measurement error at this focal length, and extract the key characteristic variables that can reflect this non-linear characteristic; use the extracted key characteristic variables as independent variables and the actually corrected temperature as the dependent variable, and use the initial data set corresponding to this focal length to construct a multivariate non-linear regression model with Lasso regularization; During the process of constructing the model, a hyperparameter optimization method is used to determine the optimal penalty coefficient in Lasso regularization, and the model with the smallest maximum absolute error is used as the optimal temperature measurement error correction model at this focal length; Evaluate the fitting effect of the optimal temperature measurement error correction model through a test set. If the evaluation result meets the preset accuracy requirement, it is determined that the temperature measurement error correction model corresponding to this focal length is established; if not, adjust the characteristic variables or optimize the model parameters, and re-construct and evaluate the model until the accuracy requirement is met.

9. The method according to any one of claims 1 to 7, wherein: For a certain model of infrared temperature measurement camera to be verified under the same focal length, use this model of camera to collect test data including the temperature to be corrected, the temperature measurement distance, the ambient temperature, and the actually corrected temperature to form a test data set for this model; Input the temperature to be corrected, the temperature measurement distance, the ambient temperature, etc. in the test data set into the established error correction model corresponding to this focal length to obtain the corrected temperature predicted by the model; Calculate the error between the corrected temperature predicted by the model and the actually corrected temperature in this test data set, and this error is the verification error; Calculate the temperature compensation value according to the verification error. If the verification error is the difference between the predicted value and the actual value of the model, the temperature compensation value is the opposite of this difference. By adding this temperature compensation value to the original temperature measurement result of this model of camera, the correction of the temperature measurement error is realized.

10. The method according to claim 9, wherein: If the verification error is within the preset allowable range, it indicates that this error correction model has good generalization ability for this model of camera, and the temperature compensation method can be directly used for temperature measurement error correction; if the verification error exceeds the preset allowable range, analyze the cause of the error and adjust and optimize the error correction model, including at least adding characteristic variables specific to this model of camera, adjusting model parameters, etc., and then re-conduct the generalization ability verification and temperature compensation value calculation until the verification error is within the allowable range.

Citation Information

Cited By

  • High-throughput counting method for small pineapple fruits

    CN121170485A