A data analysis-based lung function instrument data processing method and system
By using a data analysis-based pulmonary function instrument data processing system and the XGBoost classification model, the problem of generating reliable test reports for home users has been solved, enabling intelligent analysis and diagnostic suggestions based on user measurement data.
Patent Information
- Application Number
- CN202510353849.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-03-25
AI Technical Summary
How home users can generate a relatively reliable test result report based on the parameters measured by a simple pulmonary function tester is an urgent problem to be solved.
A data processing system based on data analysis of a pulmonary function instrument is adopted. It is connected to a cloud platform through a peak expiratory flow meter. The XGBoost classification model is used to preprocess and analyze user measurement data, construct feature vectors, and output the prediction results of ventilation disorders.
It effectively prevents user measurement errors from affecting model prediction results, ensures the reliability of model prediction results, and provides intelligent diagnostic suggestions.
Smart Images

Figure CN119889668B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical assistance and pulmonary function testing technology, specifically to a data processing method and system for a pulmonary function instrument based on data analysis. Background Technology
[0002] In pulmonary function testing and evaluation, ventilation function is the most basic and important component. The use of a simple pulmonary function analyzer for ventilation function testing is an important tool for hospitals and departments at all levels, and a primary means of testing in primary hospitals or health checkups. Pulmonary function testing has the following characteristics: (1) It has significant guiding significance for clinical diagnosis and treatment; (2) It is non-invasive; (3) It is convenient for repeated testing; (4) It has high sensitivity; (5) It is inexpensive; and (6) It is suitable for the management of chronic respiratory diseases. Its principle lies in: by measuring respiratory volume, flow rate, pressure, etc., and analyzing the composition of respiratory gases, pulmonary ventilation function and gas exchange function are determined, thereby understanding the functional status of respiratory organs and tissues.
[0003] Therefore, patients can often use peak expiratory flow meters at home for pulmonary function testing. However, for home users, generating a reliable test result report based on these measured parameters is an urgent problem to be solved. Summary of the Invention
[0004] To address the shortcomings of existing technologies, the present invention aims to overcome the aforementioned deficiencies and propose a data processing method and system for pulmonary function instruments based on data analysis.
[0005] The present invention adopts the following technical solution.
[0006] The first aspect of this invention discloses a data processing system for a pulmonary function instrument based on data analysis. The system includes multiple peak expiratory flow meters and a cloud platform, which is connected to multiple medical systems.
[0007] The peak expiratory flow meter is used to measure lung function parameters;
[0008] The cloud platform's database contains a user table and multiple data tables. The user table stores individual information input by the user and user tags. The data tables store lung function parameters, measurement time, FV curve and VT curve, and feature vectors constructed by combining individual user information.
[0009] Among them, the latest data table in the plurality of data tables is the first data table. When the amount of data stored in the first data table exceeds a first preset value, a second data table is created.
[0010] When the ventilation obstruction prediction output by the trained XGBoost classification model is inconsistent with the actual result, the inconsistent prediction result and its corresponding data table and user are marked in order to update the data table and user table.
[0011] The second aspect of this invention discloses a data processing method for a pulmonary function instrument based on data analysis, implemented using the data processing system for a pulmonary function instrument based on data analysis described in the first aspect. The method includes:
[0012] User measurement data is acquired using a peak expiratory flow meter, and the user measurement data is preprocessed.
[0013] FV and VT curves are fitted based on preprocessed user measurement data, and the correct lung function parameters are selected from the user measurement data according to the FV and VT curves to construct feature vectors in combination with static indicators.
[0014] Real-time measurement data is used as input to the trained XGBoost classification model to output predictions of ventilation obstruction.
[0015] The static index is the individual information input by the user, and the trained XGBoost classification model is trained based on the feature vector and the corresponding airway obstruction prediction results.
[0016] Furthermore, the step of acquiring user measurement data through a peak expiratory flow meter and preprocessing the user measurement data includes:
[0017] Based on the lung function parameters, an original flow vector is constructed, and the original flow vector is filtered by moving average to construct a smoothed volume flow vector and a time volume vector.
[0018] Calculate the flow change of adjacent data points of the smoothed capacity flow vector, and calculate the standard deviation of all flow changes to determine whether the capacity flow vector is smooth and continuous according to the set smoothing threshold, and perform smoothness detection on the capacity flow vector.
[0019] Wherein, the change in flow rate is the difference between the capacity flow rate vector and the adjacent data points.
[0020] Furthermore, the step of acquiring user measurement data through a peak expiratory flow meter and preprocessing the user measurement data further includes:
[0021] Extract the first time capacity vector from the smoothed time capacity vector, and calculate the adjacent increments of the first time capacity vector to calculate the average value of all adjacent increments, so as to obtain the average capacity increment.
[0022] Determine whether there are consecutive data points whose average capacity increment is lower than a first threshold, and perform interruption detection on the time capacity vector to obtain the interruption detection result;
[0023] The adjacent increment is the difference between the data point adjacent to the first time capacity vector and the first time capacity vector. When the average capacity increment of a first number of consecutive data points is lower than the first threshold, it is determined to be an interruption.
[0024] Furthermore, the process of fitting FV and VT curves based on preprocessed user measurement data, and selecting correct lung function parameters from the user measurement data according to the FV and VT curves to construct a feature vector in conjunction with static indicators, includes:
[0025] The key dynamic features are extracted from the measurement data in the form of time-series data. The key dynamic features include peak expiratory flow rate, the rate of volume increase during exhalation, the degree of deviation of the descending limb of the expiratory phase of the FV curve from the ideal straight line, and the plateau advance index.
[0026] A dynamic feature vector is constructed based on the key dynamic features, and the key dynamic features are combined with the patient's basic information and static indicators to construct the complete feature vector.
[0027] Furthermore, the step of using real-time measurement data as input to the trained XGBoost classification model to output a prediction of ventilation obstruction includes:
[0028] A training dataset is constructed based on the feature vectors, and an XGBoost classification model is established based on the training dataset. The objective function of the XGBoost classification model is composed of cross-entropy loss and tree complexity regularization term.
[0029] The training dataset is used as input to the XGBoost classification model. Cross-validation is used for parameter tuning, and a decision tree is built through iterative rounds. In each iteration, the residual is updated through gradient boosting algorithm until the objective function converges, so as to train the XGBoost classification model.
[0030] The hyperparameter settings of the XGBoost classification model include maximum depth, learning rate, subsampling ratio, and number of iterations.
[0031] Furthermore, the step of using real-time measurement data as input to the trained XGBoost classification model to output a prediction of ventilation obstruction also includes:
[0032] The accuracy of the trained XGBoost classification model is calculated through cross-validation. The accuracy is the ratio between the number of correctly classified samples and the total number of samples. The accuracy of the XGBoost classification model is evaluated when the accuracy is not lower than a second threshold.
[0033] Calculate the sensitivity and specificity for each category. The sensitivity is the ratio of the number of true positives to the sum of the number of true positives and false negatives. The specificity is the ratio of the number of true negatives to the sum of the number of true negatives and false positives. The sensitivity and specificity of the XGBoost classification model are evaluated when both the sensitivity and specificity are not lower than the third threshold.
[0034] Furthermore, the types of ventilation disorders include obstructive ventilation disorders, restrictive ventilation disorders, and mixed ventilation disorders;
[0035] The step of using real-time measurement data as input to a trained XGBoost classification model to output a prediction of ventilation obstruction includes:
[0036] The complete current feature vector of the current user is used as the input of the trained XGBoost classification model to calculate and output the probability distribution of each obstacle and the highest probability value of each category.
[0037] When the highest probability value of any category is lower than the fourth threshold, the highest probability value of the corresponding category is re-measured and recalculated until the highest probability value is not lower than the fourth threshold.
[0038] The probability distribution of each obstacle includes the probability of obstructive ventilatory impairment, the probability of restrictive ventilatory impairment, and the probability of mixed ventilatory impairment.
[0039] A third aspect of the present invention discloses a terminal, including a processor and a storage medium; characterized in that:
[0040] The storage medium is used to store instructions;
[0041] The processor is configured to operate according to the instructions to perform the steps of the method described in the second aspect.
[0042] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the steps of the method described in the second aspect.
[0043] The beneficial effects of this invention are:
[0044] (1) By fitting the FV curve and VT curve based on the preprocessed user measurement data, and selecting the correct lung function parameters from the user measurement data according to the FV curve and VT curve, and constructing feature vectors in combination with static indicators, the influence of erroneous user measurement data on the model prediction results is effectively prevented, and the reliability of the model prediction results is guaranteed.
[0045] (2) The trained XGBoost classification model is used to perform intelligent analysis on the lung function parameters measured by the user and to provide corresponding analysis results and diagnostic suggestions. For users at home, it is more convenient to generate a more reliable test result report and provide corresponding diagnostic suggestions based on the parameters measured by the peak expiratory flow meter. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the structure of a data processing system for a pulmonary function instrument based on data analysis.
[0047] Figure 2 This is a flowchart of a data processing method for a pulmonary function instrument based on data analysis.
[0048] Figure 3 This is a schematic diagram of a lung function test table and curves for a lung function instrument data processing method based on data analysis in a specific embodiment.
[0049] Figure 4 This is a schematic diagram of the respiratory requirement curve of a data processing method for a pulmonary function instrument based on data analysis in a specific embodiment;
[0050] Figure 5 This is a schematic diagram of the measurement requirement curve for a data processing method for a pulmonary function instrument based on data analysis in a specific embodiment. Detailed Implementation
[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0052] like Figure 1 As shown, in one embodiment, a data processing system for a pulmonary function instrument based on data analysis includes multiple peak expiratory flow meters and a cloud platform, which is connected to multiple medical systems.
[0053] Peak expiratory flow meters are used to measure lung function parameters.
[0054] The cloud platform's database contains a user table and multiple data tables. The user table stores individual information input by the user and user tags, while the data tables store lung function parameters, measurement time, FV curves and VT curves, as well as feature vectors constructed by combining individual user information.
[0055] Among the multiple data tables, the latest data table is the first data table. When the amount of data stored in the first data table exceeds a first preset value, a second data table is created.
[0056] When the ventilation obstruction prediction output by the trained XGBoost classification model is inconsistent with the actual result, the inconsistent prediction result and its corresponding data table and user are marked in order to update the data table and user table.
[0057] like Figure 2 As shown, in one embodiment, a data processing method for a pulmonary function instrument based on data analysis includes the following steps:
[0058] Step S110: Acquire user measurement data through a peak expiratory flow meter and preprocess the user measurement data.
[0059] In some embodiments, the data processing method for a pulmonary function instrument based on data analysis provided by the present invention includes the following steps in step S110:
[0060] Step S111: Construct the original flow vector based on lung function parameters, and perform moving average filtering on the original flow vector to construct a smoothed volume flow vector and time volume vector.
[0061] Step S112: Calculate the flow change of adjacent data points of the smoothed capacity flow vector, and calculate the standard deviation of all flow changes to determine whether the capacity flow vector is smooth and continuous according to the set smoothing threshold, and perform smoothness detection on the capacity flow vector.
[0062] Here, the change in flow rate is the difference between the capacity flow rate vector and the adjacent data points.
[0063] In some embodiments, the data processing method for a pulmonary function instrument based on data analysis provided by the present invention further includes the following steps in step S110:
[0064] Step S113: Extract the first time capacity vector from the smoothed time capacity vector, and calculate the adjacent increments of the first time capacity vector to calculate the average value of all adjacent increments, and obtain the average capacity increment.
[0065] Step S114: Determine whether there is an average capacity increment of a first number of consecutive data points that is lower than a first threshold, perform interruption detection on the time capacity vector, and obtain the interruption detection result.
[0066] The adjacent increment is the difference between the data point adjacent to the first time capacity vector and the first time capacity vector. When the average capacity increment of a first number of consecutive data points is lower than the first threshold, it is determined to be an interruption.
[0067] Step S120: Fit the FV curve and VT curve based on the preprocessed user measurement data, and select the correct lung function parameters from the user measurement data according to the FV curve and VT curve, so as to construct a feature vector in combination with static indicators.
[0068] Among them, static indicators are individual information input by the user. Lung function parameters are obtained by measuring peak expiratory flow rate, including respiratory volume, flow rate, pressure, and respiratory gas composition used to assess lung ventilation and gas exchange function.
[0069] In some embodiments, the data processing method for a pulmonary function instrument based on data analysis provided by the present invention includes the following steps in step S120:
[0070] Step S121: Extract key dynamic features from the time-series measurement data. Key dynamic features include peak expiratory flow rate, the rate of volume increase during exhalation, the degree of deviation of the descending limb of the expiratory phase of the FV curve from the ideal straight line, and the plateau advance index.
[0071] Step S122: Construct a dynamic feature vector based on key dynamic features, and combine the key dynamic features with the patient's basic information and static indicators to construct a complete feature vector.
[0072] Step S130: Use real-time measurement data as input to the trained XGBoost classification model to output the prediction result of ventilation obstruction.
[0073] The trained XGBoost classification model is obtained by training based on feature vectors and corresponding ventilation impairment prediction results. Types of ventilation impairment include obstructive ventilation impairment, restrictive ventilation impairment, and mixed ventilation impairment.
[0074] In some embodiments, the data processing method for a pulmonary function instrument based on data analysis provided by the present invention includes the following steps before step S130:
[0075] Step S210: Construct a training dataset based on feature vectors, and establish an XGBoost classification model based on the training dataset. The objective function of the XGBoost classification model is composed of cross-entropy loss and tree complexity regularization term.
[0076] Step S220: The training dataset is used as input to the XGBoost classification model. Cross-validation is used for parameter tuning, and a decision tree is built through iterative rounds. In each iteration, the residual is updated until the objective function converges using the gradient boosting algorithm, so as to train the XGBoost classification model.
[0077] The hyperparameter settings for the XGBoost classification model include maximum depth, learning rate, subsampling ratio, and number of iterations.
[0078] In some embodiments, the data processing method for a pulmonary function instrument based on data analysis provided by the present invention further includes the following steps before step S130:
[0079] Step S310: Calculate the accuracy of the trained XGBoost classification model through cross-validation. The accuracy is the ratio between the number of correctly classified samples and the total number of samples. The accuracy evaluation of the XGBoost classification model is completed when the accuracy is not lower than the second threshold.
[0080] Step S320: Calculate the sensitivity and specificity for each category. Sensitivity is the ratio of the number of true positives to the sum of the number of true positives and false negatives. Specificity is the ratio of the number of true negatives to the sum of the number of true negatives and false positives. The sensitivity and specificity assessment of the XGBoost classification model are completed when both sensitivity and specificity are not lower than the third threshold.
[0081] In some embodiments, the data processing method for a pulmonary function instrument based on data analysis provided by the present invention includes the following steps in step S130:
[0082] Step S131: Use the complete current feature vector of the current user as the input of the trained XGBoost classification model to calculate and output the probability distribution of each obstacle and the highest probability value of each category.
[0083] Step S132: When the highest probability value of any category is lower than the fourth threshold, the highest probability value of the corresponding category is re-measured and calculated until the highest probability value is not lower than the fourth threshold.
[0084] The probability distribution of each obstacle includes the probability of obstructive ventilatory impairment, the probability of restrictive ventilatory impairment, and the probability of mixed ventilatory impairment.
[0085] In this embodiment, the criteria for determining obstructive ventilatory impairment are that the descending branch of the expiratory phase of the FV curve is concave towards the horizontal axis, the VT curve shows prolonged expiratory time, and the flow index FEV1 / FVC decreases.
[0086] The criteria for determining restrictive ventilatory impairment are a narrowing and elongated horizontal axis in the FV curve, an early appearance of the expiratory plateau in the VT curve with a downward vertical axis, and a decrease in volume parameters.
[0087] The criteria for diagnosing mixed ventilation disorder are narrowing of the horizontal axis of the FV curve and concavity of the descending branch of the expiratory phase towards the horizontal axis, a decrease in the vertical axis of the VT curve and a prolonged expiratory time, and a decrease in all volume and flow indicators.
[0088] The aforementioned data analysis-based pulmonary function instrument data processing method fits FV and VT curves to preprocessed user measurement data and selects correct pulmonary function parameters from the user measurement data based on the FV and VT curves. This is then combined with static indicators to construct a feature vector, effectively preventing erroneous user measurements from affecting the model's prediction results and ensuring the reliability of the predictions. Furthermore, the trained XGBoost classification model intelligently analyzes the user-measured pulmonary function parameters and provides corresponding analysis results and diagnostic suggestions. For home users, this method makes it easier to generate a more reliable test result report and provide corresponding diagnostic suggestions based on the parameters measured by the peak expiratory flow meter.
[0089] In a specific embodiment, the present invention provides a data processing method for a pulmonary function instrument based on data analysis. This method is implemented on the basis of a data processing system for a pulmonary function instrument based on data analysis. The system includes: multiple peak expiratory flow meters and a cloud platform, and the cloud platform is connected to various clinic and hospital systems.
[0090] The cloud platform database has a user table created for each user. The user table includes at least the following fields: userID: used to uniquely identify the user, usually the user's login account ID, or its mapping expression; password: login password; info: various basic information of the user.
[0091] User test data (such as FV curves and VT curves) is stored in another table (such as data_1, data_2, data_3, etc.). Typically, data_i will have a master table named datas, recording information about data_i. The master table datas usually includes at least the following fields: name: used to record the specific name of the current data_i (actually determining the specific value of i); btm: the creation time of data_i; num: the number of data points in data_i. data_i itself includes the following fields: userID: username; tm: the user's test time; datas: test data information, which in this example could be the complete feature vector X_user.
[0092] During the application process, the value of num corresponding to the latest data_i is determined. If its value exceeds a preset threshold of 1 (usually 2000), a new data_j is created, where j = i + 1. The data in data_i is stored according to a time scale and includes data from all users.
[0093] If a discrepancy arises between the predicted and diagnosed results, the information in data_i needs to be updated immediately (i.e., data backtracking). Therefore, the choice of algorithm for storing X_user in datas is crucial, as it should contain as much user data as possible to facilitate data backtracking.
[0094] The user table also includes the following field: mark: used to mark discrepancies between the prediction and diagnosis results. The mark is designed to automatically increment by 1. For example, if the first user has a discrepancy between the prediction and diagnosis results, then the mark for the first user is 1; if the second user has a discrepancy between the prediction and diagnosis results, then the mark for the first user is 2, and so on.
[0095] When the value of the mark exceeds a preset threshold of 2, data backtracking is initiated. This approach minimizes the number of data backtracking iterations, reducing the storage pressure on the database. In this example, the threshold of 2 can be set to a fixed constant, such as 100, or it can be determined by the timing of model retraining. That is, when the model begins retraining, since it needs to acquire historical data for training, data backtracking will be initiated regardless of the value of the mark.
[0096] The following content includes the relevant terms and their explanations:
[0097] BTP: Body temperature (37 °C), saturated water vapor, and ambient pressure.
[0098] Peak expiratory flow rate (PEF): The maximum flow rate measured at the mouth immediately after the lungs have expanded to their maximum capacity and exhalation begins with maximum force.
[0099] Peak expiratory meter (PEFM): A device used to measure peak expiratory flow rate.
[0100] Step 1: Data preprocessing and data inspection.
[0101] Combination Figure 3 As shown, pulmonary function tests include at least the following parameters:
[0102] FEV1: Forced expiratory volume in the first second.
[0103] FVC: The maximum amount of air that can be exhaled during a forceful exhalation after a maximal inhalation.
[0104] FEV6: Forced expiratory volume in the 6th second.
[0105] MMEF: Mid-expiratory Flow Rate.
[0106] MVV: The maximum amount of spontaneous breathing that an individual can do in a given time (usually one minute).
[0107] IC: The maximum amount of air an individual can inhale at the end of a quiet exhalation, which is the sum of tidal volume (TV) and inspiratory reserve volume (IRV).
[0108] ERV: The maximum amount of air an individual can exhale at the end of a calm exhalation.
[0109] Determining whether a user's measurement is correct mainly includes:
[0110] For exhalation requirements, see Figure 4 As shown: (1) Exhalation reaches maximum effort, the PEF peak appears rapidly, the extrapolated volume is <5% FVC or 0.15L, and the expiratory phase descending limb curve is smooth. (2) There is no interruption in the expiratory process, no coughing, no teeth or tongue blocking the mouthpiece, no air leakage, and no glottal closure affecting the test. (3) Exhalation lasts at least 6 seconds. If the expiratory time is <6 seconds, the time-volume curve must show the appearance of the expiratory phase plateau for more than 1 second.
[0111] It should be noted that, Figure 4 In the text, Flow represents flow rate, Volume represents volume, Cough represents coughing, Time represents time, and Actual FVC represents actual FVC.
[0112] For testing requirements, please refer to [link / reference]. Figure 5As shown: (1) During the measurement process, the subject is required to be measured at least 3 times (generally no more than 8 times). (2) The difference between the best and second-best values of FEV1 and FVC is less than 0.15L.
[0113] It should be noted that, Figure 5 In this context, "Acceptable efforts" indicates an acceptable range, while "Good effort" indicates an experiment that meets the requirements.
[0114] However, for cases where there is no interruption in the exhalation process, no coughing, no obstruction of the mouthpiece by teeth or tongue, no air leakage, and no glottal closure affecting the test, the specific judgment can be made by combining the following steps for analysis:
[0115] Step 1.1, Data preprocessing and smoothing vector construction.
[0116] Noise filtering is applied to the raw lung function parameters to construct smooth volume-flow vectors and smooth temporal-volume vectors, ensuring that subsequent obstacle category predictions are not affected by noise.
[0117] Filtering and noise reduction: A moving average filter is applied to the vector, and its expression is:
[0118] ;
[0119] In the formula, Let i be the smoothed flow rate value. For the i-th capacity flow vector, The recommended value for the filter window size is 3 to 7 (determined based on the sampling frequency). At the same time, the capacity in the time capacity vector is subjected to similar filtering to obtain a smooth time capacity vector. This is a floor function used to ensure that the window length is an integer.
[0120] For example, if the original flow vector By using a window size of W=3, the smoothed capacity flow vector can be obtained. .
[0121] Step 1.2, Smoothness detection (detecting flow continuity).
[0122] Determine whether the volume-flow vector is smooth and continuous, thus reflecting the absence of abnormal interruptions or drastic fluctuations during exhalation (such as coughing or instrument blockage).
[0123] Specifically, calculate the difference between adjacent flow rates: for the smoothed capacity flow vector Calculate the flow changes between adjacent data points Its expression is:
[0124] ;
[0125] In the formula, To and Adjacent data points, i=1,2,...,n-1, where n is the total number of data points.
[0126] Calculate all flow changes The standard deviation of is expressed as:
[0127] ;
[0128] In the formula, This is the standard deviation function.
[0129] Set smoothness threshold (Recommended range: 0.5~2.0 liters / second), if If the data is smooth, then the smoothness test is considered to be satisfied.
[0130] Step 1.3, Interrupt detection (detecting abnormal interrupts in the capacity-time vector).
[0131] Determine if there is an interruption during exhalation (such as coughing, obstruction, or air leakage), i.e., whether there are consecutive abnormally low (close to zero) volume increments in the volume-time vector.
[0132] Specifically, for the smoothed time capacity vector In the middle, extract the capacity and calculate the adjacent increment. Its expression is:
[0133] ;
[0134] In the formula, Let i be the capacity increment from the i-th data point to the (i+1)-th data point. Let i be the adjacent data points of i, i = 1, 2, ..., m-1, where m is the total number of data points.
[0135] Calculate the average capacity increment, that is, find all average , This represents the average value function.
[0136] Interrupt Detection: Define the criteria for judging continuous interruptions. If continuous interruptions exist... Each data point All below 0.5× If the value is approximately zero or abnormally low, it is considered that an interruption exists, meaning the interruption detection fails; otherwise, the interruption detection passes.
[0137] For example, suppose the calculation yields If it increases, then 0.5 × =0.025 liters, if in a certain data segment 5 consecutive If all values are less than 0.025 liters, an interruption is considered to exist; otherwise, the interruption detection passes.
[0138] Step 1.4: Determine whether the following conditions are met: "no interruption during exhalation, no coughing, no teeth or tongue blocking the mouthpiece, no air leakage, and no glottal closure affecting the test".
[0139] By combining the smoothness test result R1 and the intermediate test result R2, a comprehensive judgment is made on whether the exhalation process is uninterrupted and free from abnormal interference, thereby determining whether it meets the requirements.
[0140] Specifically, define the final result. for:
[0141] ;
[0142] in, This indicates the smoothness test result. This indicates that the detection result has been interrupted. , All tests were passed. This indicates that the requirements are met, meaning that the exhalation process is uninterrupted and free from abnormal interference. This indicates that the requirements are not met.
[0143] Step 2: Analyze the user's correct measurement results.
[0144] The analysis results mainly included: obstructive ventilatory impairment, restrictive ventilatory impairment, and mixed ventilatory impairment.
[0145] The characteristics of the three types of ventilation disorders mentioned above are as follows:
[0146] Obstructive ventilatory dysfunction: The descending limb of the expiratory phase of the FV curve is concave towards the horizontal axis; the VT curve shows prolonged expiratory time; the flow index FEV1 / FVC decreases; FEV1 changes from normal to decreasing.
[0147] Restrictive ventilatory impairment: The horizontal axis of the FV curve narrows, and the curve becomes elongated; the vertical axis of the VT curve declines, and the expiratory plateau appears prematurely; the volume index VC (FVC) decreases; FEV1 changes from normal to decreased.
[0148] Mixed ventilation disorder: The horizontal axis of the FV curve narrows, and the descending limb of the expiratory phase is concave towards the horizontal axis; the VT curve shows a downward trend on the vertical axis and a prolonged expiratory time; volume and flow parameters FVC, FEV1, and FEV1 / FVC all decrease.
[0149] In this embodiment, during the analysis process, based on the capacity flow vector That is, each element Represents the filtered instantaneous flow rate (liters / second) and the time capacity vector. That is, each element of a binary tuple , Time (seconds) This is the cumulative expiratory volume (L). Combining basic patient information and static pulmonary function indicators, including: age, height, weight, gender (male=1, female=0); VC, TLC (allowable fluctuation ±20%); FRC, RV (allowable fluctuation ±20%~35%, even 40%); RV / TLC (20%~35% in healthy young adults, increasing with age); FEV1, FVC, PEF (static measurements, lower reference limit 80%); FEV1 / FVC (expected greater than 92%); MVV (≥75% is normal, 60%~75% is mildly decreased, 40%~60% is moderately decreased, <40% is severely decreased), the analysis results and diagnostic suggestions are output, indicating whether the patient has obstructive ventilatory dysfunction, restrictive ventilatory dysfunction, or mixed ventilatory dysfunction, and providing further medical advice.
[0150] Specifically, step 2 includes the following steps:
[0151] Step 2.1, Feature extraction and data construction.
[0152] Key dynamic features reflecting the morphology of FV and VT curves are extracted from time-series data, and a complete feature vector is constructed by combining static indicators to capture the clinical characteristics of various ventilation disorders.
[0153] First, extract the dynamic feature PEF (Peak Expiratory Flow): , which represents the highest flow rate during exhalation and is used to reflect the downward trend commonly seen in obstructive ventilatory disorders.
[0154] Secondly, calculate the average slope. :
[0155] ;
[0156] The average slope is used to reflect the volume throughout the entire exhalation process. As the rate of increase over time increases, restrictive ventilatory disorders often present as a narrow curve with a large average slope, while mixed ventilatory disorders are both narrow and accompanied by prolonged expiratory time.
[0157] Curve concavity index (CI): Defined as the degree of deviation of the descending limb of the expiratory phase of the FV curve from the ideal straight line (from the starting point to the PEF point). The calculation formula is as follows:
[0158] ;
[0159] in, The predicted flow rate of the j-th data point on the linear model (calculated by the straight line formed by the starting point and the PEF point). The number of data points from the PEF point to the last data point. Let be the j-th smoothed volume-flow vector. In obstructive ventilatory impairment, the descending limb of the expiratory phase is concave towards the horizontal axis, and the CI is higher. Mixed ventilatory impairment also shows a concave appearance.
[0160] Platform advance indicator (PI): Defines the timing of the expiratory plateau using the VT curve. The starting point when the continuous rate of volume change is below a certain threshold (e.g., less than 50% of the average increment), compared with the total expiratory time. ratio:
[0161] ;
[0162] Restrictive ventilatory disorders are often characterized by an early expiratory plateau (PI), while obstructive ventilatory disorders are characterized by a prolonged expiratory time and a high PI.
[0163] The above dynamic features are structured into a vector: Each element represents, in turn, the peak expiratory flow rate, the average slope, the curve height index, and the plateau advance index. Then, the dynamic features are combined with the aforementioned patient basic information and static indicators to construct a complete feature vector.
[0164] Step 2.2, XGBoost model construction and training.
[0165] Using the constructed training dataset ( An XGBoost classification model was established to distinguish between obstructive, restrictive, and mixed ventilation disorders.
[0166] In this embodiment, the objective function of the XGBoost classification model for:
[0167] ;
[0168] In the formula, The cross-entropy loss (for multi-class classification) is expressed as follows:
[0169] ;
[0170] C=3, This is a regularization term for tree complexity.
[0171] Hyperparameter settings: Maximum learning rate Range 3~10; Learning rate Range 0.01~0.3; Subsampling ratio Range: 0.5~1.0; Number of iterations: 300 (adjusted according to data volume).
[0172] During model training, Input the XGBoost library, use cross-validation to tune parameters, and build a decision tree iteratively round by round. In each round of iteration, use the gradient boosting method to update the residuals until the objective function converges, so as to improve the accuracy and intelligence of the trained XGBoost classification model in distinguishing various ventilation obstacles.
[0173] Step 2.3, Model performance evaluation and validation.
[0174] The trained XGBoost classification model was rigorously evaluated through cross-validation to ensure that it has higher accuracy, sensitivity and specificity in distinguishing between obstructive, restrictive and mixed ventilatory disorders. Based on the parameters measured by the peak expiratory flow meter, it generates a more reliable prediction result and provides corresponding diagnostic suggestions for home users.
[0175] Cross-validation is used to calculate accuracy: Accuracy = Number of correctly classified samples / Total number of samples
[0176] Calculate the sensitivity and specificity for each category: Sensitivity = TP / (TP + FN), Specificity = TN / (TN + FP)
[0177] Among them, TP, FN, TN, and FP represent the number of true positives, false negatives, true negatives, and false positives, respectively.
[0178] Indicator requirements: Overall accuracy ≥ 80%, target is 90% in this case; sensitivity and specificity for each category ≥ 75%.
[0179] Step 2.4, User data prediction and diagnostic suggestions output.
[0180] The trained XGBoost classification model is used to predict the complete feature vector of the current user, output the specific lung function status classification result, and provide detailed diagnostic suggestions in combination with clinical curve features.
[0181] Model prediction: Using the complete feature vector of the current user Input the trained XGBoost classification model, calculate and output the probability distribution of obstacles for each category. :
[0182] ;
[0183] in, This indicates the probability of a predicted obstructive ventilatory disorder. This indicates the probability of a predicted restrictive ventilatory disorder. This indicates the probability of a predicted mixed ventilatory disorder.
[0184] The final predicted category is the ventilation disorder category with the highest probability.
[0185] In this embodiment, the criteria for determining obstructive ventilatory dysfunction are: the descending branch of the expiratory phase of the FV curve is concave towards the horizontal axis (high concavity index CI), the VT curve shows prolonged expiratory time, and the flow index FEV1 / FVC decreases.
[0186] The criteria for determining restrictive ventilatory impairment are: narrowing of the horizontal axis of the FV curve, resulting in a long and narrow shape; a downward trend in the vertical axis of the VT curve, with an earlier expiratory plateau (lower PI); and a decrease in volume indicators VC and FVC.
[0187] The criteria for diagnosing mixed ventilation disorder are: the presence of both a concave FV curve and a narrowed curve; a VT curve showing a downward vertical axis and prolonged expiratory time; and a decrease in all volume and flow indicators.
[0188] According to the prediction results The corresponding diagnostic suggestions are as follows:
[0189] like If it is obstructive, the output will be: "Suspected obstructive ventilatory dysfunction. The descending limb of the expiratory phase of the FV curve is concave towards the horizontal axis, the VI curve shows prolonged expiratory time, and the flow index FEV1 / FVC is decreased. Further detailed pulmonary function tests and respiratory etiology assessment are recommended."
[0190] like If the condition is (restrictive), the output will be: "Suspected restrictive ventilatory disorder. The FV curve is narrowed and elongated on the horizontal axis, the VT curve shows an early expiratory plateau and a downward trend on the vertical axis, and volume indicators (VC, FVC) are decreased. It is recommended to examine the chest wall, respiratory muscles and lung interstitium, and to go to the hospital for a follow-up examination if necessary."
[0191] like (Mixed) The output will be: "Suspected mixed ventilatory disorder. The FV curve shows narrowing of the horizontal axis and the descending limb of the expiratory phase sinking back to the horizontal axis. The VT curve shows a downward trend in the vertical axis and prolonged expiratory time. At the same time, volume and flow indicators (FVC, FEV1, FEV1 / FVC) are all decreased. It is recommended to seek medical attention in time to clarify the diagnosis."
[0192] Output prediction confidence: Simultaneously output the highest probability value of the predicted category (e.g., confidence ≥ 70% is relatively reliable). If it is lower than this value, the measurement and prediction can be repeated.
[0193] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. "A plurality of" means two or more, unless otherwise explicitly specified.
[0194] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0195] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0196] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0197] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0198] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0199] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0200] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0201] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0202] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A data processing system for a pulmonary function instrument based on data analysis, characterized in that, The system includes multiple peak expiratory flow meters and a cloud platform, which is connected to multiple medical systems; The peak expiratory flow meter is used to measure lung function parameters; The cloud platform's database contains a user table and multiple data tables. The user table stores individual information input by the user and user tags. The data tables store lung function parameters, measurement time, FV curve and VT curve, and feature vectors constructed by combining individual user information. Among them, the latest data table in the plurality of data tables is the first data table. When the amount of data stored in the first data table exceeds a first preset value, a second data table is created. When the ventilation obstruction prediction results output by the trained XGBoost classification model are inconsistent with the actual results, the inconsistent prediction results and their corresponding data tables and users are marked in order to update the data tables and user tables. The system includes a data processing method for a pulmonary function instrument based on data analysis, the method comprising: User measurement data is acquired using a peak expiratory flow meter, and the user measurement data is preprocessed. FV and VT curves are fitted based on preprocessed user measurement data, and the correct lung function parameters are selected from the user measurement data according to the FV and VT curves to construct feature vectors in combination with static indicators. Real-time measurement data is used as input to the trained XGBoost classification model to output predictions of ventilation obstruction. Wherein, the static index is individual information input by the user, and the trained XGBoost classification model is trained based on the feature vector and the corresponding ventilation disorder prediction results; the step of acquiring user measurement data through a peak expiratory flow meter and preprocessing the user measurement data includes: Based on the lung function parameters, an original flow vector is constructed, and the original flow vector is filtered by moving average to construct a smoothed volume flow vector and a time volume vector. Calculate the flow change of adjacent data points of the smoothed capacity flow vector, and calculate the standard deviation of all flow changes to determine whether the capacity flow vector is smooth and continuous according to the set smoothing threshold, and perform smoothness detection on the capacity flow vector. Wherein, the change in flow rate is the difference between the capacity flow rate vector and the adjacent data points.
2. A data processing method for a pulmonary function instrument based on data analysis, implemented using the data processing system for a pulmonary function instrument based on data analysis as described in claim 1, characterized in that, The step of acquiring user measurement data through a peak expiratory flow meter and preprocessing the user measurement data further includes: Extract the first time capacity vector from the smoothed time capacity vector, and calculate the adjacent increments of the first time capacity vector to calculate the average value of all adjacent increments, thus obtaining the average capacity increment. Determine whether there are consecutive data points whose average capacity increment is lower than a first threshold, and perform interruption detection on the time capacity vector to obtain the interruption detection result; The adjacent increment is the difference between the data point adjacent to the first time capacity vector and the first time capacity vector. When the average capacity increment of a first number of consecutive data points is lower than the first threshold, it is determined to be an interruption.
3. The data processing method for a pulmonary function instrument based on data analysis according to claim 2, characterized in that, The process involves fitting FV and VT curves based on preprocessed user measurement data, and selecting correct lung function parameters from the user measurement data according to the FV and VT curves to construct a feature vector in conjunction with static indicators, including: Key dynamic features are extracted from the measurement data in the form of time-series data. These key dynamic features include peak expiratory flow rate, the rate of volume increase during expiration, the deviation of the expiratory descending limb of the FV curve from the ideal straight line, and the plateau advance index. A dynamic feature vector is constructed based on the key dynamic features, and the key dynamic features are combined with the patient's basic information and static indicators to construct the complete feature vector.
4. The data processing method for a pulmonary function instrument based on data analysis according to claim 3, characterized in that, The step of using real-time measurement data as input to a trained XGBoost classification model to output a prediction of ventilation obstruction includes: A training dataset is constructed based on the feature vectors, and an XGBoost classification model is established based on the training dataset. The objective function of the XGBoost classification model is composed of cross-entropy loss and tree complexity regularization term. The training dataset is used as input to the XGBoost classification model. Cross-validation is used for parameter tuning, and a decision tree is built through iterative rounds. In each iteration, the residual is updated through gradient boosting algorithm until the objective function converges, so as to train the XGBoost classification model. The hyperparameter settings of the XGBoost classification model include maximum depth, learning rate, subsampling ratio, and number of iterations.
5. The data processing method for a pulmonary function instrument based on data analysis according to claim 4, characterized in that, The step of using real-time measurement data as input to a trained XGBoost classification model to output a prediction of airway obstruction also includes: The accuracy of the trained XGBoost classification model is calculated through cross-validation. The accuracy is the ratio between the number of correctly classified samples and the total number of samples. The accuracy of the XGBoost classification model is evaluated when the accuracy is not lower than a second threshold. Calculate the sensitivity and specificity for each category. The sensitivity is the ratio of the number of true positives to the sum of the number of true positives and false negatives. The specificity is the ratio of the number of true negatives to the sum of the number of true negatives and false positives. The sensitivity and specificity of the XGBoost classification model are evaluated when both the sensitivity and specificity are not lower than the third threshold.
6. The data processing method for a pulmonary function instrument based on data analysis according to claim 5, characterized in that, Types of ventilation disorders include obstructive ventilation disorders, restrictive ventilation disorders, and mixed ventilation disorders; The step of using real-time measurement data as input to a trained XGBoost classification model to output a prediction of ventilation obstruction includes: The complete current feature vector of the current user is used as the input of the trained XGBoost classification model to calculate and output the probability distribution of each obstacle and the highest probability value of each category. When the highest probability value of any category is lower than the fourth threshold, the highest probability value of the corresponding category is re-measured and recalculated until the highest probability value is not lower than the fourth threshold. The probability distribution of each obstacle includes the probability of obstructive ventilatory impairment, the probability of restrictive ventilatory impairment, and the probability of mixed ventilatory impairment.
7. A terminal, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the method according to any one of claims 2-6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 2-6.
Citation Information
Patent Citations
Forced expiration total amount prediction method
CN113469227A