Body temperature prediction methods, electronic thermometers and storage media
Patent Information
- Application Number
- CN202311368544.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-20
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-10-20
AI Technical Summary
[0005]本发明的目的在于提供一种体温预测方法、电子体温计及存储介质,以解决采用NTC理论温升函数进行体温预测导致预测误差较大的问题
[0046] Compared with the prior art, the advantages of the present invention are as follows:
Smart Images

Figure CN117606639B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of body temperature prediction technology, and particularly relates to a body temperature prediction method, an electronic thermometer, and a storage medium. Background Technology
[0002] The measurement time for electronic thermometers is comparable to that of mercury thermometers, typically 5-10 minutes, so electronic thermometers do not have a significant advantage in measurement time. With the increasing prevalence of contact thermometers, the demand for rapid temperature prediction is also growing. To date, many methods and devices for rapid temperature prediction have been developed, but their accuracy and implementation complexity vary considerably. Currently, rapid temperature prediction algorithms for predictive thermometers mainly fall into several categories: regression analysis, fixed offset methods, statistical machine learning, and big data matching. Regression analysis has a simple calculation principle but a long prediction time, large prediction bias, and many outliers; statistical machine learning requires high-end hardware and is costly; big data matching is difficult to implement, requiring large amounts of clinical test data and storage units to store the matching data, resulting in high time and hardware costs.
[0003] Currently, the mainstream approach is regression analysis, which can fit curves, because it requires less measurement time compared to the fixed offset method. Compared to statistical machine learning, regression analysis is simpler and easier to implement, but it still suffers from the problem of high percentages of predicted values and large deviations.
[0004] Generally, using functions (That is, the theoretical temperature rise function of NTC (Negative Temperature Coefficient) thermistor) Establish the relationship between time t and the temperature T of the NTC thermistor, where T represents the thermistor temperature corresponding to time t, T a Indicates the initial temperature, T bLet t represent the steady-state temperature, τ represent the elapsed time, and τ represent the time constant. The initial temperature refers to the ambient temperature at which the thermometer is placed in the air at the start of the measurement. The steady-state temperature refers to the temperature read when the thermometer is placed inside the body being measured and the temperature remains relatively stable and no longer changes. The theoretical temperature rise function of NTC can completely describe the entire temperature rise curve. When the initial and steady-state temperatures are constant, the temperature rise rate of the curve depends only on the time constant τ, which is determined by the thermal conductivity of the body being measured. The core temperature of the body needs to pass through substances with different thermal conductivity, such as fat, skin, probe metal, and thermally conductive adhesive, before finally reaching the NTC detector. The heat transfer process will have different degrees of loss through different substances. Ultimately, the NTC detector detects the result of multiple segments of unsteady thermal conduction. The measured temperature rise curve is no longer a simple exponential relationship, but a complex relationship composed of an infinite number of superimposed exponential functions. At this point, the theoretical temperature rise function of the NTC thermistor can no longer perfectly model the measured temperature rise curve, resulting in a large deviation between the theoretical temperature rise curve (i.e., the predicted temperature rise curve) and the measured temperature rise curve, meaning a large prediction error. Figure 1 As shown, when the initial temperature and steady-state temperature are the same, regardless of the time constant, the measured temperature rise curve (i.e., Figure 1 The actual temperature rise curve and the predicted temperature rise curve (i.e., the actual temperature rise curve) Figure 1 The theoretical temperature rise curves in the model cannot be perfectly superimposed, therefore, directly using the NTC theoretical temperature rise function for modeling (i.e., constructing a predicted temperature rise curve) will result in a large prediction error. Heat loss during the heat transfer process slows down heat transfer, leading to a longer time to reach steady-state temperature. Summary of the Invention
[0005] The purpose of this invention is to provide a body temperature prediction method, an electronic thermometer, and a storage medium to solve the problem of large prediction errors caused by using the NTC theoretical temperature rise function for body temperature prediction.
[0006] This invention solves the above-mentioned technical problems through the following technical solution: a body temperature prediction method, comprising the following steps:
[0007] Real-time acquisition of measured body temperature data collected according to the sampling period;
[0008] Set a time window, and determine the zero point of the measured temperature rise curve based on the time window and the measured body temperature data.
[0009] The optimal coefficients of the body temperature prediction function are determined based on the measured body temperature data after midnight; wherein, the body temperature prediction function is a logarithmic function.
[0010] The primary expression of the body temperature prediction function is determined based on the optimal coefficients;
[0011] The initial expression of the body temperature prediction function is linearly calibrated to obtain the final expression of the body temperature prediction function.
[0012] Body temperature is predicted using the final expression of the body temperature prediction function.
[0013] Furthermore, the zero point of the measured temperature rise curve is determined based on the time window and the measured body temperature data, specifically including:
[0014] Within the time window, calculate the difference between two adjacent measured body temperatures;
[0015] The time of the measured body temperature corresponding to the maximum difference is taken as the zero point of the measured temperature rise curve.
[0016] Furthermore, an iterative regression method is used to determine the optimal coefficients of the body temperature prediction function based on the measured body temperature data after the zero point in time. The specific implementation process is as follows:
[0017] Step 3.1: Initialize the fitting time start point;
[0018] Step 3.2: Determine whether the starting point of the fitting time is less than or equal to the set threshold. If yes, proceed to step 3.3; otherwise, output the optimal coefficient of the body temperature prediction function.
[0019] Step 3.3: Starting from the fitting time start point, extract a set of measured body temperature data from the measured body temperature data after the zero point of time according to the extraction period. The body temperature observation sequence is composed of this set of measured body temperature data, where the extraction period is longer than the sampling period.
[0020] Step 3.4: Perform regression analysis on the body temperature observation sequence to obtain the coefficients of the body temperature prediction function for the body temperature observation sequence;
[0021] Step 3.5: Substitute the coefficients obtained in Step 3.4, the last measured body temperature in the body temperature observation sequence and its acquisition time into the body temperature prediction function to calculate the predicted body temperature corresponding to the last measured body temperature;
[0022] Substitute the coefficients obtained in step 3.4, the second-to-last measured body temperature in the body temperature observation sequence and its acquisition time into the body temperature prediction function to calculate the predicted body temperature corresponding to the second-to-last measured body temperature;
[0023] Step 3.6: Substitute the predicted body temperature calculated in Step 3.5, the last measured body temperature and the second to last measured body temperature in the body temperature observation sequence into the objective function to calculate the target value;
[0024] Step 3.7: When the target value ≤ the minimum target value, the optimal coefficient is updated to the coefficient corresponding to the target value, the minimum target value is updated to the target value, the fitting time start point is updated, and the process proceeds to step 3.2; when the target value > the minimum target value, the fitting time start point is updated, and the process proceeds to step 3.2.
[0025] Furthermore, the primary expression of the body temperature prediction function is:
[0026] T = a opt ×ln(t)+b opt
[0027] Where T is the predicted body temperature, t is the data collection time, and a opt b opt All are optimal coefficients;
[0028] The final expression for the body temperature prediction function is:
[0029] T = A × (a opt ×ln(t)+b opt )+B
[0030] Where A and B are both linear calibration coefficients.
[0031] Furthermore, the objective function is:
[0032]
[0033] Where Dis is the target value, q is the weight, and n is the number of data points in the body temperature observation sequence. This is the predicted body temperature calculated based on the nth measured body temperature in the body temperature observation sequence and its corresponding acquisition time. This is the predicted body temperature calculated based on the (n-1)th measured body temperature in the body temperature observation sequence and its corresponding acquisition time. This is the nth measured body temperature in the body temperature observation sequence. This is the (n-1)th measured body temperature in the body temperature observation sequence.
[0034] Furthermore, before performing regression analysis on the body temperature observation sequence, the method further includes: shifting the acquisition time in the body temperature observation sequence, specifically using the following shifting formula:
[0035] t i '=(t i -t0)+1
[0036] Among them, t i ' is the acquisition time after translation processing, t i t0 represents the i-th acquisition time in the body temperature observation sequence, and t0 is the starting point of the fitting time.
[0037] Furthermore, the primary expression of the body temperature prediction function is linearly calibrated, specifically including:
[0038] Statistical analysis of measured and predicted body temperatures of different subjects;
[0039] Linear fitting was performed on the measured and predicted body temperatures of all subjects to obtain the linear calibration coefficients.
[0040] The primary expression of the body temperature prediction function is linearly calibrated based on the linear calibration coefficient to obtain the final expression of the body temperature prediction function.
[0041] Based on the same concept, the present invention also provides an electronic thermometer, the electronic thermometer comprising:
[0042] Memory, used to store computer programs;
[0043] A processor for executing the computer program to implement the body temperature prediction method as described above.
[0044] Based on the same concept, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the body temperature prediction method as described above.
[0045] Beneficial effects
[0046] Compared with the prior art, the advantages of the present invention are as follows:
[0047] This invention uses a logarithmic function as the body temperature prediction function. The logarithmic function is a first-order model with only two parameters, which has the advantages of being simple and easy to calculate and not prone to overfitting. Compared with the traditional theoretical temperature rise function of NTC thermistors, the logarithmic function has higher prediction accuracy. At the same time, the optimal coefficient solves the problem of large prediction deviation caused by the misalignment of the first point when fitting the temperature rise curve with the logarithmic function.
[0048] This invention redefines the zero point of the measured temperature rise curve, avoiding the influence of measured body temperature data in the unstable segment on the determination of the optimal coefficient, improving the accuracy of the body temperature prediction function expression, and further improving the prediction precision.
[0049] This invention only models the latter part of the near logarithmic relationship. The choice of the fitting time starting point determines the degree of fitting or prediction of the predicted temperature rise curve. When using the iterative regression method to determine the optimal coefficients, the optimal fitting time starting point is used as the basis, which further improves the accuracy of the optimal coefficients and avoids the problems of inaccurate sampling, prediction error or large fitting error caused by fixing the fitting time starting point.
[0050] This invention also uses statistically based linear calibration coefficients for final calibration, which increases the complexity of the expression, improves the fitting ability of the expression, and further reduces temperature prediction bias. Attached Figure Description
[0051] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only one embodiment of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a comparison chart of the measured temperature rise curve and the theoretical temperature rise curve constructed using the theoretical temperature rise function of the NTC thermistor under the same initial temperature and steady-state temperature conditions in the background technology of this invention.
[0053] Figure 2 This is a flowchart of the body temperature prediction method in an embodiment of the present invention;
[0054] Figure 3 This is a flowchart illustrating the determination of optimal coefficients using the iterative regression method in this embodiment of the invention.
[0055] Figure 4 This is a graph of measured body temperature data extracted according to the extraction cycle in an embodiment of the present invention;
[0056] Figure 5 This is a comparison chart of the predicted temperature rise curve and the measured temperature rise curve, with the optimal fitting time starting point as the starting point, in an embodiment of the present invention.
[0057] Figure 6 This is the distribution trend line of the predicted-measured data points and the fitted data of 118 groups of test subjects in this embodiment of the invention. Detailed Implementation
[0058] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] The technical solutions of this application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0060] like Figure 2 As shown in the figure, a body temperature prediction method provided by an embodiment of the present invention includes the following steps:
[0061] Step 1: Real-time acquisition of measured body temperature data collected according to the sampling period;
[0062] Step 2: Set the time window, and determine the zero point of the measured temperature rise curve based on the time window and the measured body temperature data;
[0063] Step 3: Determine the optimal coefficients of the body temperature prediction function based on the measured body temperature data after midnight; the body temperature prediction function is a logarithmic function.
[0064] Step 4: Determine the primary expression of the body temperature prediction function based on the optimal coefficients;
[0065] Step 5: Perform linear calibration on the primary expression of the body temperature prediction function to obtain the final expression of the body temperature prediction function;
[0066] Step 6: Use the final expression of the body temperature prediction function to predict body temperature.
[0067] In step 1, the sampling rate of the measured body temperature data is 10Hz, meaning that 10 measured body temperatures can be collected per second, with a sampling period of 0.1s. During actual measurement, the body temperature fluctuates as the contact thermometer is placed and touches the skin, then stabilizes and rises rapidly after the thermometer is clamped. To discard the unstable portion of the measured body temperature data and avoid its influence on the subsequent determination of the optimal coefficient, step 2 uses the first-order difference method to redetermine the zero point of the measured temperature rise curve. The specific implementation process is as follows:
[0068] Step 2.1: Within the time window, calculate the difference between two adjacent measured body temperatures;
[0069] Step 2.2: Take the time of the measured body temperature corresponding to the maximum difference as the zero point of the measured temperature rise curve.
[0070] In this embodiment, the time window is set to 2 seconds. When the sampling rate of the measured body temperature data is 10Hz, the number of measured body temperatures collected within the time window is 20. These 20 measured body temperatures are arranged in chronological order of collection time, and the difference between two adjacent measured body temperatures is calculated. The collection time of the measured body temperature corresponding to the largest difference is taken as the zero point of the measured temperature rise curve. The formula for calculating the difference is:
[0071] ΔT i =T i -T i-1 (1)
[0072] Where, ΔT i T represents the difference between two adjacent measured body temperatures. i T represents the i-th measured body temperature within the time window. i-1This represents the (i-1)th measured body temperature within the time window. When ΔT... i When the difference is at its maximum, T i The corresponding acquisition time is used as the zero point of the measured temperature rise curve, and T is discarded. i The actual body temperature data before the corresponding collection time.
[0073] The basal body temperature prediction function of this invention uses a logarithmic function, specifically:
[0074] T=a×ln(t)+b (2)
[0075] Where T is the predicted body temperature, t is the collection time, and a and b are coefficients.
[0076] The actual human body temperature rise curve is a non-steady-state heat transfer process. The measured temperature rise curve is composed of countless exponential functions, making direct modeling and calculation overly complex. Heat transfer losses slow down the process, resulting in a longer time to reach steady-state temperature. A simpler approach is to avoid modeling the complete measured temperature rise curve (i.e., constructing a predicted temperature rise curve) and instead model only the latter part of the measured temperature rise curve. The body temperature prediction function of this invention uses a logarithmic function, modeling only the latter part of the near-logarithmic relationship. During the modeling process (i.e., determining the coefficients of the body temperature prediction function), determining the starting point of the logarithmic relationship segment (i.e., the starting point of the fitting time for the latter part) is crucial. The choice of the starting point determines the degree of fit or prediction of the predicted temperature rise curve. The optimal starting point sampling can be completely fitted by the logarithmic function, thus accurately predicting the temperature.
[0077] This invention uses the theoretical temperature rise function as a reference function and derives and proves that the logarithmic function can model or fit the latter part of the predicted temperature rise curve. To model the latter part of the temperature rise curve, the theoretical temperature rise function needs to be rewritten. The rewritten theoretical temperature rise function for the latter part is as follows:
[0078]
[0079] Where t0 is the starting point of the fitting time, and t is the acquisition time after translation processing in the body temperature observation sequence.
[0080] By fitting the temperature rise curve formula of the later stage using a logarithmic function, i.e., requiring equation (2) to be equal to equation (3), we obtain:
[0081]
[0082] t represents the acquisition time after translation processing in the body temperature observation sequence, and the domain of the logarithmic function ranges from t∈[1,t... state ], t stateThe time required to reach steady-state temperature is typically 10 minutes. When t = 1, the time of the theoretical temperature rise function on the left side of equation (4) is equal to the fitting time starting point t0, and the time of the logarithmic function on the right side is equal to 1. In other words, when using the logarithmic function for modeling, setting the fitting time starting point to 1 and substituting t = 1, we can solve for:
[0083]
[0084] At this point, the coefficient b is equal to the body temperature corresponding to the starting point of the fitting time. Substituting equation (5) into equation (4), simplifying and rearranging terms, and then considering the fitting error ε between the fitted function and the logarithmic function, we get:
[0085]
[0086] The fitting error ε is a variable within the domain of t, so let -0.1 < ε < 0.1. When t = 1, we can deduce that ε = 0, because the right side of equation (6) is a monotonic function, so the larger t is, the larger the fitting error ε is. When t = 2, we can approximate that the logarithm of the left side of equation (6) can still perfectly fit the exponent of the right side, so let ε = 0 as well. When t = t state At this point, the fitting error ε reaches its maximum value ε=±0.1. Therefore, equation (6) can be expressed as a system of equations:
[0087]
[0088] Assuming T is known a T b If τ , then the system of equations can be solved for a and t0. Using a numerical iteration-based method, calculations show that T a T b The impact on the fitting time starting point t0 is minimal and can be ignored. The value of t0 is primarily affected by the time constant τ. Theoretically, t0 can be calculated as long as the time constant τ is known, but in actual measurements with contact electronic thermometers, it is impossible to obtain the precise time constant for each test subject. The accuracy of the time constant directly affects the accuracy of the t0 solution; inaccurate t0 will lead to excessive prediction bias. Directly solving for the fitting time starting point numerically is not feasible in practical applications.
[0089] The logarithmic function is used to logarithmically fit the latter segment of the overall temperature rise curve. The latter segment of the temperature rise curve serves as the fitted curve (i.e., the predicted temperature rise curve), and the logarithmic function serves as the fitting function. To accurately fit the temperature rise curve, the first point of the fitting function and the fitted curve segment needs to be aligned; this is the key to logarithmic regression. On one hand, the starting point of the fitting time for the fitted temperature rise curve (i.e., the predicted temperature rise curve) cannot be easily obtained directly, and individual differences can cause the starting point to shift forward or backward, making it impossible to fix. Therefore, this invention uses an iterative regression method to obtain the corresponding optimal fitting time starting point and optimal coefficients a and b for each predicted temperature rise curve. The iterative regression method starts from the initialized fitting time starting point, extracts measured body temperature data at equal time intervals, performs regression analysis on the extracted measured body temperature data to obtain coefficients, then substitutes these coefficients and calculates the weighted first-order norm deviation of the last two measured body temperatures. The fitting time starting point is then iterated and the extraction is repeated. The regression analysis process and the deviation calculation process minimize the weighted first-order norm deviation, ultimately obtaining the optimal coefficients. The optimal coefficients not only fit the sampling points well but also accurately predict the steady-state temperature. The iterative fitting time starting point method avoids the problems of inaccurate sampling and large fitting errors caused by fixing the fitting time starting point. This invention determines the optimal fitting time starting point while using iterative regression to determine the optimal coefficients; determining the optimal fitting time starting point aligns the first point of the fitted function and the fitted curve segment.
[0090] In one specific embodiment of the present invention, an iterative regression method is used to determine the optimal coefficient 'a' of the body temperature prediction function based on the measured body temperature data after the zero point in time. opt b opt ,like Figure 3 As shown, its specific implementation process is as follows:
[0091] Step 3.1: Initialize the fitting time start point;
[0092] Step 3.2: Determine whether the starting point of the fitting time is less than or equal to the set threshold. If yes, proceed to step 3.3; otherwise, output the optimal coefficient of the body temperature prediction function.
[0093] Step 3.3: Starting from the fitting time start point, extract a set of measured body temperature data from the measured body temperature data after the zero point of time according to the extraction period. The body temperature observation sequence is composed of this set of measured body temperature data, where the extraction period is longer than the sampling period.
[0094] Step 3.4: Perform regression analysis on the body temperature observation sequence to obtain the coefficients of the body temperature prediction function for the body temperature observation sequence;
[0095] Step 3.5: Substitute the coefficients obtained in Step 3.4, the last measured body temperature in the body temperature observation sequence, and its collection time into the body temperature prediction function to calculate the predicted body temperature corresponding to the last measured body temperature; substitute the coefficients obtained in Step 3.4, the second-to-last measured body temperature in the body temperature observation sequence, and its collection time into the body temperature prediction function to calculate the predicted body temperature corresponding to the second-to-last measured body temperature.
[0096] Step 3.6: Substitute the predicted body temperature calculated in Step 3.5, the last measured body temperature in the body temperature observation sequence, and the second to last measured body temperature into the objective function to calculate the target value;
[0097] Step 3.7: When the target value is less than or equal to the minimum target value, the optimal coefficient is updated to the coefficient corresponding to the target value, that is, the coefficient corresponding to the target value is used as the new optimal coefficient, the minimum target value is updated to the target value, that is, the target value is used as the new minimum target value, the fitting time start is updated, and the process proceeds to step 3.2; when the target value is greater than the minimum target value, the optimal coefficient and the minimum target value are not updated, the fitting time start is updated, and the process proceeds to step 3.2.
[0098] In this embodiment, the initial value of the fitting time starting point t0 is 3s, and the threshold is set to 8s, that is, iterating within 3 to 8s; when updating the fitting time starting point, the step size is 0.5s, that is, the updated fitting time starting point t0' is equal to the original fitting time starting point t0 plus 0.5s, i.e., t0' = t0 + 0.5.
[0099] Modeling or fitting the temperature rise curve using a logarithmic function only models the latter part of the curve, not the entire temperature rise process. The temperature rise rate drops sharply in the latter part; therefore, in step 3.3, extracting data at equal time intervals is more suitable than sampling at body temperature. The temperature rise curve is a time series, and the probability of the time series model appearing is P(x1,x2,…,x…). T )=Π t=1 P(x t |x t-1 ,x t-2 The sequence P(x1, x2, ..., x1) can be simplified to a first-order Markov chain P(x1, x2, ..., x2). T )=Π t= 1P(x t |x t-1 ,x t-2 ,x t-3 This also shows that the closer the observation is to the predicted value, the more important it is. Conversely, the farther the observation is from the predicted value, the less important it may be. Thus, the weighting tends to 0. In other words, in extrapolation prediction, the predicted value depends more on the observations that are closer to the predicted value. Figure 4This is a graph of measured body temperature data extracted at equal time intervals (i.e., according to the extraction period). Clearly, as the rate of temperature rise decreases, equal time intervals will collect more measured body temperatures in the later stages of the same temperature change. However, the sampling time interval for isothermal sampling becomes longer in the later stages, resulting in fewer measured body temperature data collected within the same time frame. As a predictive regression method, it is more necessary to fit the measured body temperature points in the later stages, and equal time interval sampling meets this requirement. Furthermore, regression analysis can better fit the measured body temperature points in the later stages, making the prediction results more accurate. In this embodiment, the equal time extraction interval (i.e., the extraction period) is set to 2 seconds. In step 3.3, the body temperature observation sequence can be represented as sample_buff=[(t1,T(t1)),(t2,T(t2)),(t3,T(t3)),(t4,T(t4)),…], t i+1 =t i +2, t1 = t0, where t0 is the starting point of the fitting time.
[0100] The measured body temperature data acquired in step 1 uses the collection start point as the zero point, while the extracted body temperature observation sequence uses the time zero point determined in step 2 as the zero point. The collection start point is the collection time corresponding to the first measured body temperature. Assuming the collection start point is the zero point, the sampling rate is 10Hz, and measured body temperature data from 0 to 15 seconds are acquired in real time, the time zero point determined according to the time window is 1 second, i.e., ΔT. 10 =T 10 -T9 is the maximum. The collection time (1s) corresponding to the 10th measured body temperature within the 2s time window is the zero point of time. Then, the measured body temperature data within 0 to 1s is discarded, and the measured body temperature data within 1 to 15s is retained. The measured body temperature data after the zero point of time is the measured body temperature data within 0 to 14s, and all data within 14s are recorded.
[0101] To avoid wasting microcontroller memory, after determining the zero point, data sampling begins from that point. Sampling continues, but not every data point is recorded; only the data used is recorded. For example, starting from zero, if data up to the 3rd second is needed, the temperature and time at the 3rd second are recorded. After timing 2 seconds (until 5 seconds, since the subsequent extraction cycle is 2 seconds), the temperature and time are recorded again, and so on. The resulting measured body temperature data after zero are measured at 3s, (3+2)s, (3+2+2)s, ...
[0102] When the extraction period is 2s and the initial fitting time start is 3 seconds, the measured body temperature data corresponding to 3s, (3+2)s, (3+2+2)s, (3+2+2+2)s, (3+2+2+2)s, (3+2+2+2+2)s, and (3+2+2+2+2+2)s are extracted from the measured body temperature data from 0 to 14s (this is for the case where all data is recorded; if only the data used is recorded according to the fitting time start and extraction period, then the recorded data is the body temperature observation sequence). The body temperature observation sequence can be represented as sample_buff=[(3,T(3)),(5,T(5)),(7,T(7)),(9,T(9)),(11,T(11)),(13,T(13))]. By performing regression analysis on the body temperature observation sequence, the coefficients a and b of the body temperature prediction function can be obtained.
[0103] The domain of a logarithmic function is [0, +∞], and its range is [-∞, any value]. However, the temperature change range of the measured temperature rise curve is finite, so the range of time t does not belong to [0, +∞]. According to the properties of the logarithmic function, regardless of the base, when t = 1, T = 0. This meets the requirements and simplifies the modeling. Therefore, the range of t is set to [1, t...]. state ], t state The time required to reach steady-state temperature. Because this invention only models the latter part of the measured temperature rise curve, the acquisition time should be expressed as a relative time. Therefore, before performing regression analysis on the body temperature observation sequence, the acquisition time in the body temperature observation sequence is shifted. In this embodiment of the invention, the starting point of the fitting time is set to 1 and the relative time of the entire body temperature observation sequence is obtained, that is, the starting point of the fitting time is shifted to 1 second, and the subsequent acquisition times are shifted sequentially. The specific formula is:
[0104] t i '=(t i -t0)+1 (8)
[0105] Among them, t i ' is the acquisition time after translation processing, t i t0 represents the i-th acquisition time in the body temperature observation sequence, and t0 is the starting point of the fitting time.
[0106] For example, when the extraction period is 2 seconds, the sample time of the body temperature observation sequence is sample_time = [t0, t0+2, t0+4, t0+6, ...], and the shifted sample time is [(t0-t0)+1, (t0+2-t0)+1, (t0+4-t0)+1, (t0+6-t0)+1, ...]. When t0 = 3 seconds, the shifted sample time is sample_time = [1, 3, 5, 7, ...]. Figure 5As shown, the dashed line represents the predicted temperature rise curve obtained by fitting data extracted according to the extraction period, with the optimal fitting time as the starting point of the predicted temperature rise curve. It has a high degree of fit with the actual temperature rise curve (i.e., the measured temperature rise curve) and can accurately predict the steady-state temperature.
[0107] In step 3.4, the regression analysis of the body temperature observation sequence is the process of fitting the measured body temperature data in the body temperature observation sequence to calculate the coefficients of the body temperature prediction function. In this embodiment, the logarithmic function (2) is simplified to linear regression, and the least squares method is used to solve for the coefficients a and b. Let x = ln(t), then the logarithmic function becomes a linear function:
[0108] T(x) = ax + b (9)
[0109] The body temperature observation sequence after taking the logarithm of time is [(x1,T(x1)),(x2,T(x2)),(x3,T(x3)),(x4,T(x4)),…], and the objective function of the least squares method can be expressed as:
[0110]
[0111] Where n is the number of measured body temperatures in the body temperature observation sequence.
[0112] Minimizing the objective function can be achieved by taking partial derivatives. By taking the partial derivatives with respect to the coefficients a and b, we obtain the system of equations:
[0113]
[0114] Solving equation (11), we get:
[0115]
[0116] This yields the optimal coefficients for the current body temperature observation sequence, but this does not necessarily mean they are the optimal coefficients for the measured temperature rise curve. The result may show a better fit for the initial segment of the data collection point but a poorer fit for the later segment, ultimately leading to significant prediction bias. Therefore, to better fit the measured body temperature data in the later segment of the data collection point and in conjunction with iterative regression, this invention proposes a weighted first-order norm as the objective function, specifically expressed as:
[0117]
[0118] Where Dis is the target value, q is the weight, and n is the number of body temperature observation sequences. This is the predicted body temperature calculated based on the nth measured body temperature in the body temperature observation sequence and its corresponding acquisition time. This is the predicted body temperature calculated based on the (n-1)th measured body temperature in the body temperature observation sequence and its corresponding acquisition time. This refers to the nth measured body temperature in the body temperature observation sequence (i.e., the last measured body temperature). This refers to the (n-1)th measured body temperature in the body temperature observation sequence (i.e., the second to last measured body temperature).
[0119] For example, the measured body temperature data after midnight is the measured body temperature data from 0 to 14 seconds, and the body temperature observation sequence is sample_buff=[(3,T(3)),(5,T(5)),(7,T(7)),(9,T(9)),(11,T(11)),(13,T(13))], then To calculate the coefficients a and b by substituting the entire body temperature observation sequence into equation (12), and then substituting the last measured body temperature and its acquisition time (i.e., (13,T(13))), coefficients a and b into equation (2) to calculate the predicted body temperature corresponding to 13 seconds, T n tru This refers to the last measured body temperature in the body temperature observation sequence, specifically the measured body temperature at 13 seconds. The weighted first-norm objective function represents the weighted sum of the absolute deviations of the predicted body temperature at the last time point and the second-to-last time point. The closer the observation is to the prediction time, the greater its weight. Experiments have shown that a weight q of 0.8 is optimal.
[0120] To minimize the objective value Dis, multiple objective values are obtained by updating the starting point of the fitting time. When the initial value of the starting point is 3, the threshold is set to 8, and the update step size is 0.5, iterations are needed at t0 = 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8 (11 iterations), resulting in 11 objective values Dis. The coefficient corresponding to the minimum objective value Dis is then taken as the optimal coefficient a. opt b opt The optimal coefficient a opt b opt The corresponding fitting time starting point is then the optimal fitting time starting point. In the first iteration, the target value is not compared with the minimum target value; instead, the target value obtained in the first iteration is used as the minimum target value, or a larger value is set as the minimum target value.
[0121] In step 4, the primary expression of the body temperature prediction function is:
[0122] T = a opt ×ln(t)+b opt (14)
[0123] t state Substituting into equation (14), the steady-state temperature can be calculated.
[0124] In another specific embodiment of the present invention, the optimal coefficients and optimal fitting time start point of the body temperature prediction function can also be determined by an optimization algorithm, such as the particle swarm optimization algorithm. Specifically, the range of values for the coefficients and the fitting time start point is determined first, and then the position and velocity of each particle in the particle swarm are initialized within the range of values. The optimal coefficients and optimal fitting time start point are obtained by initializing the position and velocity of the particles.
[0125] To further improve prediction accuracy, equation (14) is linearly calibrated. On the one hand, in actual testing environments, individual differences such as age, weight, and gender of test subjects lead to different temperature rise curves at the same starting temperature and steady-state temperature. On the other hand, the temperature of the testing environment, temperature changes during the test, the test subject's usage habits, and different placement positions can all introduce new noise into the actual observations, which can significantly affect the prediction. Due to the influence of noise and individual differences, the measured temperature rise curve is sometimes not a perfect logarithmic curve, which can cause the logarithmic function to be unable to effectively fit or predict the measured temperature rise curve. Insufficient fitting ability will lead to prediction bias. To reduce prediction bias, the predicted body temperature can be compensated.
[0126] This invention proposes a method based on large-scale data statistics to obtain a calibration line, and uses the mapping of the calibration line to compensate for predicted body temperature. The specific implementation process is as follows:
[0127] Step 5.1: Statistically analyze the measured body temperature and predict the body temperature of different subjects;
[0128] Step 5.2: Perform linear fitting on the measured and predicted body temperatures of all subjects to obtain the linear calibration coefficients;
[0129] Step 5.3: Perform linear calibration on the primary expression of the body temperature prediction function according to the linear calibration coefficient to obtain the linearly calibrated expression of the body temperature prediction function, which is the final expression of the body temperature prediction function.
[0130] In step 5.1, the predicted body temperature is calculated according to equation (14). To generalize the body temperature prediction function, the test population includes test subjects of different ages, genders, body types (fat and thin), and steady-state temperatures, and it is important to ensure that different features occupy the same proportion in the dataset. There are no strict requirements on the ambient temperature or the test subject's operation of placing the thermometer. Only simple instructions on the use of the electronic thermometer need to be given to the test subject, and the test can be conducted indoors. However, it is necessary to ensure that the test subject does not eat or do strenuous exercise before the test, and remains quiet and still during the test to prevent large changes in body temperature and data fluctuations during the test. Figure 6These are the results of 118 clinical tests. The unbiased baseline means that the predicted body temperature is completely consistent with the actual body temperature. The distribution trend line is a straight line fitted based on the distribution trend of the data points determined by the 118 groups of actual body temperature and predicted body temperature. The linear calibration coefficients A and B can be determined based on this straight line.
[0131] like Figure 6 As shown, the distribution of predicted and measured data points does not perfectly coincide with the unbiased baseline. This means the predicted body temperature is not exactly equal to the measured body temperature. Furthermore, the trend line obtained by using linear regression to fit the data points is linear. Therefore, simple linear calibration provides good compensation for the predicted body temperature. The final expression for the body temperature prediction function is:
[0132] T = A × (a opt ×ln(t)+b opt )+B (15)
[0133] Table 1 shows the standard deviation before and after linear calibration. The standard deviation is the standard deviation of the body temperature data of 118 test subjects. The smaller the standard deviation, the higher the fitting accuracy and data stability. As shown in Table 1, the prediction results after linear calibration have a smaller standard deviation, and the fitting accuracy and data stability are better.
[0134] Table 1. Standard deviation analysis of 118 groups of body temperature data
[0135] Standard deviation (STD) 0.25 0.2 Bias 0 0
[0136] This invention predicts body temperature based on logarithmic functions, i.e., by constructing a body temperature prediction function or model. Fitting the predicted temperature rise curve is a specific application of regression analysis, as it relies solely on current measured data, making its calculation principle simple. However, current curve fitting methods are applied to the linear temperature rise region, i.e., the slow rise phase, typically requiring over 2 minutes for measurement. The body temperature prediction method proposed in this invention can complete the prediction during the rapid temperature rise phase, with a measurement time of no more than 20 seconds. For cases where individual differences and measurement errors lead to imperfect logarithmic relationships in the temperature rise curve, this invention also proposes a linear calibration method based on statistical distribution to obtain more accurate prediction results. The optimal coefficients are obtained by iteratively adjusting the fitting time starting point of the predicted temperature rise curve, and linear calibration (i.e., linear calibration coefficients A and B) is used to compensate for deviations in the measured data. The combination of these two methods effectively solves the problem of a high proportion of outliers in the predicted temperature rise curve. This invention not only significantly reduces prediction time but also demonstrates in clinical test results that it effectively reduces prediction bias and standard deviation, improving test consistency.
[0137] This invention also provides an electronic thermometer, which includes a processor and a memory storing a computer program, wherein the processor is configured to execute the computer program to implement the body temperature prediction method as described above.
[0138] Although not shown, the electronic thermometer includes a processor that can perform various appropriate operations and processes based on programs and / or data stored in read-only memory (ROM) or loaded from a storage portion into random access memory (RAM). The processor can be a multi-core processor or may include multiple processors. In some embodiments, the processor may include a general-purpose main processor and one or more specialized coprocessors, such as a central processing unit, graphics processing unit (GPU), neural network processor (NPU), digital signal processor (DSP), etc. Various programs and data required for the operation of the electronic thermometer are also stored in the RAM. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0139] The processor and memory described above are used together to execute programs stored in the memory. When the program is executed by a computer, it can implement the methods, steps, or functions described in the above embodiments.
[0140] Although not shown, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the body temperature prediction method as described above.
[0141] Storage media in embodiments of the present invention include articles that are permanent or non-permanent, removable or non-removable, and can store information by any method or technology. Examples of storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information that can be accessed by a computing device.
[0142] The above description only discloses specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or modifications that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for predicting body temperature, characterized in that, The prediction method includes the following steps: Real-time acquisition of measured body temperature data collected according to the sampling period; Set a time window, and determine the zero point of the measured temperature rise curve based on the time window and the measured body temperature data. The optimal coefficients of the body temperature prediction function are determined based on the measured body temperature data after midnight; wherein, the body temperature prediction function is a logarithmic function. The primary expression of the body temperature prediction function is determined based on the optimal coefficients; The initial expression of the body temperature prediction function is linearly calibrated to obtain the final expression of the body temperature prediction function. Body temperature is predicted using the final expression of the body temperature prediction function. The optimal coefficients of the body temperature prediction function are determined based on the measured body temperature data after midnight. The specific implementation process is as follows: Step 3.1: Initialize the fitting time start point; Step 3.2: Determine whether the starting point of the fitting time is less than or equal to the set threshold. If yes, proceed to step 3.3; otherwise, output the optimal coefficient of the body temperature prediction function. Step 3.3: Starting from the fitting time start point, extract a set of measured body temperature data from the measured body temperature data after the zero point of time according to the extraction period. The body temperature observation sequence is composed of this set of measured body temperature data, where the extraction period is longer than the sampling period. Step 3.4: Perform regression analysis on the body temperature observation sequence to obtain the coefficients of the body temperature prediction function for the body temperature observation sequence; Step 3.5: Substitute the coefficients obtained in Step 3.4, the last measured body temperature in the body temperature observation sequence and its acquisition time into the body temperature prediction function to calculate the predicted body temperature corresponding to the last measured body temperature; Substitute the coefficients obtained in step 3.4, the second-to-last measured body temperature in the body temperature observation sequence and its acquisition time into the body temperature prediction function to calculate the predicted body temperature corresponding to the second-to-last measured body temperature; Step 3.6: Substitute the predicted body temperature calculated in Step 3.5, the last measured body temperature and the second to last measured body temperature in the body temperature observation sequence into the objective function to calculate the target value; Step 3.7: When the target value ≤ the minimum target value, the optimal coefficient is updated to the coefficient corresponding to the target value, the minimum target value is updated to the target value, the fitting time start point is updated, and the process proceeds to step 3.2; when the target value > the minimum target value, the fitting time start point is updated, and the process proceeds to step 3.
2.
2. The body temperature prediction method according to claim 1, characterized in that, Determining the zero point of the measured temperature rise curve based on the aforementioned time window and measured body temperature data specifically includes: Within the time window, calculate the difference between two adjacent measured body temperatures; The time of the measured body temperature corresponding to the maximum difference is taken as the zero point of the measured temperature rise curve.
3. The body temperature prediction method according to claim 1, characterized in that, The primary expression for the body temperature prediction function is: in, To predict body temperature, For the time of collection, , All are optimal coefficients; The final expression for the body temperature prediction function is: in, , All are linear calibration coefficients.
4. The body temperature prediction method according to claim 1, characterized in that, The objective function is: in, For the target value, As weight, n The number of body temperature observation sequences, Based on the body temperature observation sequence, the first... n The predicted body temperature is calculated from the measured body temperature and its corresponding collection time. Based on the body temperature observation sequence, the first... n The predicted body temperature is calculated from one measured body temperature and its corresponding collection time. The first in the body temperature observation sequence n A measured body temperature, The first in the body temperature observation sequence n -1 measured body temperature.
5. The body temperature prediction method according to claim 1, characterized in that, Before performing regression analysis on the body temperature observation sequence, the method further includes: shifting the acquisition time in the body temperature observation sequence, with the specific shifting formula being: in, The acquisition time after translation processing. The first in the body temperature observation sequence Each collection time, This is the starting point for the fitting time.
6. The body temperature prediction method according to claim 1, characterized in that, The initial value of the fitting time start point is 3s, and the set threshold is 8s.
7. The body temperature prediction method according to any one of claims 1 to 6, characterized in that, The primary expression of the body temperature prediction function is linearly calibrated, specifically including: Statistical analysis of measured and predicted body temperatures of different subjects; Linear fitting was performed on the measured and predicted body temperatures of all subjects to obtain the linear calibration coefficients. The primary expression of the body temperature prediction function is linearly calibrated based on the linear calibration coefficient to obtain the final expression of the body temperature prediction function.
8. An electronic thermometer, characterized in that, The electronic thermometer includes: Memory, used to store computer programs; A processor for executing the computer program to implement the body temperature prediction method as described in any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the body temperature prediction method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method for analyzing health data of old people on basis of Cox regression model
CN105678104A
Dynamic estimation method for thermometer
CN109855765A