An AI algorithm-based lung function report automatic quality control method, system, electronic device and storage medium
By using an improved ResNet deep learning algorithm, which combines morphological features of lung function curves with numerical parameters, the problem of insufficient utilization of curve morphological features and individual differences in lung function report quality control is solved, achieving efficient and accurate quality control rating.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 北京啄木鸟云健康科技有限公司
- Filing Date
- 2026-01-07
- Publication Date
- 2026-05-29
AI Technical Summary
Current lung function report quality control relies on manual review, making it difficult to accurately identify quality problems during the testing process, such as coughing or air leakage caused by poor patient cooperation. Furthermore, traditional automated quality control software cannot effectively utilize curve morphology characteristics and individual differences, leading to misjudgments and inaccurate quality control results.
By employing an improved ResNet deep learning algorithm, a quality control rule engine is constructed through morphological feature extraction and numerical combination of lung function curves, enabling accurate and automated rating of detection quality.
It enables accurate identification and automated rating of lung function test quality, reduces the risk of misdiagnosis and missed diagnosis, improves quality control efficiency and accuracy, and provides expert-level quality control.
Smart Images

Figure CN122117210A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medical information processing and artificial intelligence technology, and in particular to an automated quality control method, system, electronic device and storage medium for lung function reporting based on AI algorithms. Background Technology
[0002] Pulmonary function tests are an important tool for diagnosing respiratory diseases, assessing their severity, and monitoring treatment efficacy. The FV curve (flow-volume curve) and VT curve (volume-time curve) are core data in pulmonary function tests, containing important information about the patient's respiratory mechanics.
[0003] However, current quality control of lung function reports mainly relies on manual review. In primary healthcare institutions, due to a lack of professionally trained physicians, it is difficult to accurately identify quality problems during the testing process (such as coughing, air leaks, and premature glottal closure caused by poor patient cooperation). Most existing automated quality control software relies solely on simple rule-based judgments based on numerical parameters (such as FVC, FEV1, PEF, and PET) in the ATS / ERS (American Thoracic Society / European Respiratory Society) standards. This rule-based approach has significant limitations: 1. Insufficient use of curve information: The shape characteristics of the curve are ignored, and details such as abnormal fluctuations and inflection points cannot be captured, resulting in many reports with actual waveforms that are not up to standard but whose values barely meet the standards being misjudged as up to standard.
[0004] 2. Weak anomaly detection capability: For specific operational problems such as coughing or air leakage that cause data distortion, it is difficult to make qualitative identification based solely on numerical values.
[0005] 3. Insufficient accuracy of results: Individual differences were not considered, the quality control results were general, and no specific improvement suggestions could be given.
[0006] Therefore, there is an urgent need for an automated quality control technology that can "understand" the curve shape like a human expert and make comprehensive judgments in combination with numerical standards. Summary of the Invention
[0007] The main objective of this invention is to provide an automated quality control method, system, electronic device, and storage medium for lung function reports based on AI algorithms. It utilizes an improved ResNet to deeply mine the morphological features of lung function curves and combines them with a rule engine to achieve accurate and automated rating of the detection quality.
[0008] The first aspect of this invention discloses an automated quality control method for lung function reports based on AI algorithms, the method comprising: Step S1 Data Acquisition and Analysis: Acquire raw data from lung function tests. The raw data includes the subject's basic information, lung function index parameters, and curve data. The curve data includes flow-volume curve (FV curve) data and / or volume-time curve (VT curve) data. Step S2 Data Preprocessing: Normalize and transform the curve data to convert one-dimensional time series or coordinate point data into two-dimensional matrix data to construct the model input feature map; Step S3 Intelligent Feature Recognition: The processed model input feature map is input into a pre-trained deep residual network model, which extracts the deep morphological features of the curve and outputs the quality control classification result of the curve; the quality control classification result is used to indicate whether there are anomalies in the curve and the type of anomaly; Step S4: Comprehensive quality control rating: Based on the quality control classification results, acceptable curves are selected, and the best and second-best values in the lung function index parameters are combined to calculate the quality level of the lung function report using a preset quality control rule engine. Step S5 Output: The output includes an automated quality control report containing anomaly type information and quality level.
[0009] Preferably, in step S2, the specific process of converting one-dimensional time series or coordinate point data into two-dimensional matrix data is as follows: Extract the first N data points of each curve; if the number of data points is less than N, pad with zeros. The completed data points are reorganized into a feature matrix of dimension H×W×C; The original curve data contains two-dimensional coordinates, with a total data volume of N×2, and the transformed matrix satisfies H×W=N×2; Where N is 800, the transformed feature matrix has a dimension of 40×40×1.
[0010] Preferably, the deep residual network model in step S3 includes: Input layer: Used to receive the feature matrix after dimensionality transformation; Initial convolution stage: includes convolutional layers with a kernel size of 5×5 and max pooling layers, used for initial dimensionality reduction and feature extraction; Residual extraction stage: It contains multiple cascaded residual stages, each of which contains several bottleneck residual blocks; each bottleneck residual block contains three convolutional layers and passes gradients through skip connections. Output layer: Contains a global average pooling layer and a fully connected layer, used to output the probability of anomaly categories.
[0011] Preferably, the training process of the deep residual network model employs a segmented decreasing learning rate adjustment strategy: The initial learning rate is used in the first T1 rounds of training; In the middle T2 round of training, the learning rate is adjusted to 1 / 10 of the initial learning rate; In the final T3 round of training, the learning rate is adjusted to 1 / 100 of the initial learning rate; Furthermore, during the training process, data augmentation was performed on the training samples, which included randomly stretching or compressing the vertical axis of the flow curve.
[0012] Preferably, the types of abnormalities output by the model in step S3 include at least: cough, premature glottal closure, inadequate inspiration, expiratory pause, insufficient burst of power, air leakage, mouthpiece blockage, and hesitancy at the start of exhalation.
[0013] Preferably, in step S4, the rating logic of the quality control rule engine includes: If the number of acceptable curves is ≥3, and the difference between the best and second-best FEV1 values is <0.15L, and the difference between the best and second-best FVC values is <0.15L, it is judged as Grade A; If the number of acceptable curves is ≥3, and at least one of the differences between the best and second-best values of FEV1 and FVC is <0.2L, it is judged as Grade B; If the number of acceptable curves is ≥2, and at least one of the differences between the best and second-best values of FEV1 and FVC is <0.25L, it is judged as Grade C; If the number of acceptable curves is ≥2 but does not meet the C-level standard, or if the number of acceptable curves is 1, it is judged as D-level; If the number of acceptable curves is 0, it is judged as Grade F; Among them, FEV1 is the forced expiratory volume in one second, and FVC is the forced vital capacity.
[0014] A second aspect of this invention discloses an automated quality control system for lung function reporting based on AI algorithms, the system comprising: Data acquisition module: used to acquire raw test data from lung function testing equipment, PDF reports, or cloud platforms; Preprocessing module: used to extract curve data, truncate or pad it to a fixed length, and then reshape it into a two-dimensional feature matrix; AI inference module: Deployed with a pre-trained deep residual network model, used to perform convolution operations on the two-dimensional feature matrix, identify the morphological features of the curve, and determine whether there are any operational anomalies. Rule calculation module: Used to generate quality control ratings based on the number of acceptable curves and the repeatability differences of lung function indicators determined by the AI inference module, according to preset standards. Interactive display module: used to display quality control rating results, causes of anomalies, and original curves.
[0015] A third aspect of this invention discloses an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the automated quality control method for lung function reporting based on an AI algorithm, as described in any of the first aspects of this disclosure.
[0016] A fourth aspect of this invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of an AI-based automated quality control method for lung function reporting according to any one of the first aspects of this disclosure.
[0017] The beneficial effects of this invention are as follows: 1. Precise Morphological Recognition: Innovatively converting curve data into a two-dimensional matrix, and utilizing ResNet's powerful feature extraction capabilities, it can identify morphological anomalies that traditional rule-based methods cannot detect (such as minor coughs, hesitation at the start of exhalation, etc.).
[0018] 2. Full-process automation: It realizes fully automated processing from data parsing to final rating, which greatly reduces the workload of doctors and improves quality control efficiency.
[0019] 3. Objective and unified standards: It avoids the subjective differences of manual review, provides expert-level quality control for primary healthcare, and effectively reduces the risk of misdiagnosis and missed diagnosis. Attached Figure Description
[0020] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0021] Figure 1 This is a flowchart of an automated quality control method for lung function reporting based on an AI algorithm according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the model structure of the deep residual network (ResNet) in an embodiment of the present invention.
[0022] Figure 3 This is a system architecture diagram provided in an embodiment of the present invention.
[0023] Figure 4 This is a schematic diagram of the dimensional transformation of curve data during data preprocessing.
[0024] Figure 5 This is a structural diagram of an automated quality control system for lung function reporting based on an AI algorithm, according to an embodiment of the present invention. Figure 6 This is a structural diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0026] Definitions: FV curve: A graph used in pulmonary function tests to assess lung ventilation function. The horizontal axis represents lung volume (liters, L), indicating the total amount of gas in the lungs during exhalation or inspiration. The vertical axis represents gas flow rate (liters per second, L / s), indicating the amount of gas exhaled or inhaled per unit time. VT curve: A graph used in pulmonary function tests to assess lung ventilation function. The horizontal axis represents time (seconds, s), recording the duration of respiratory actions. The vertical axis represents lung volume (liters, L), indicating the total amount of air exhaled or inhaled. FVC (Forced Vital Capacity): The maximum amount of air that can be exhaled at the fastest speed after a maximal inhalation. FEV1 (Forced Expiratory Volume in One Second): The amount of air forcefully exhaled in the first second after maximal inhalation; PEF (Peak Expiratory Flow): The highest instantaneous flow rate that can be achieved during forced exhalation; PET (Expiratory Time): The total time required to complete a maximal exhalation; ResNet (Residual Network): A deep neural network architecture that introduces residual blocks, enabling the network to directly pass shallow features to deep layers. This effectively alleviates the gradient vanishing and performance degradation problems during deep network training, achieving more efficient feature extraction and model optimization.
[0027] The first aspect of this invention discloses an automated quality control method for lung function reports based on AI algorithms. This invention aims to overcome the limitations of existing lung function quality control technologies by utilizing deep learning algorithms. Through precise interpretation of lung function curves, it fully mines the patient's physiological state and operational process information contained within the curves, accurately identifying abnormalities such as coughing and air leakage during the testing process. This overcomes the shortcomings of existing technologies, such as insufficient utilization of curve information, inability to identify abnormalities, and inaccurate quality control results, achieving precise control over the quality of lung function testing and providing more reliable and accurate diagnostic evidence for clinical practice.
[0028] Pulmonary function testing is a core tool for assessing respiratory health, and the accuracy of its results directly impacts clinical diagnosis and treatment decisions. However, traditional quality control relies on manual review, which suffers from low efficiency, high subjectivity, and a high rate of missed detections. This system aims to build an intelligent quality control platform based on ResNet to automate the detection and scoring of abnormal events in post-event data. It covers seven typical abnormalities, including cough, premature glottal closure, inspiratory insufficiency, expiratory apnea, insufficient burst power, air leakage, and mouthpiece blockage, thereby improving quality control efficiency and the reliability of results.
[0029] Figure 1 This is a flowchart of an automated quality control method for lung function reporting based on an AI algorithm according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes: Step S1 Data Acquisition and Analysis: Acquire raw data from lung function tests. The raw data includes the subject's basic information, lung function index parameters, and curve data. The curve data includes flow-volume curve (FV curve) data and / or volume-time curve (VT curve) data. In some specific embodiments, the relevant data is processed as follows: Data sources include offline data exported from pulmonary function testing equipment, PDF report parsing (for specific brands such as Jaeger), and data pushed from cloud platforms.
[0030] Key field extraction: Extract parameters such as patient ID, FVC (forced vital capacity), FEV1 (forced expiratory volume in one second), PEF (peak expiratory flow rate), PET (expiratory time), and coordinate point data of FV and VT curves.
[0031] Data annotation and augmentation: During the model training phase, a large amount of historical data was collected, and clinical experts annotated the curves with abnormality types (such as normal, cough, air leakage, premature glottal closure, inadequate inspiration, expiratory pause, insufficient burst power, hesitant expiratory initiation, mouthpiece blockage, etc.). To balance the sample, stratified sampling was used to ensure that each class had more than 2000 samples, and time-series distortion technology (randomly stretching the vertical axis of the flow rate curve by ±10%) was used for data augmentation.
[0032] Step S2 Data Preprocessing: Normalize and transform the curve data to convert one-dimensional time series or coordinate point data into two-dimensional matrix data to construct the model input feature map; In step S2, the specific process of converting one-dimensional time series or coordinate point data into two-dimensional matrix data is as follows: Extract the first N data points of each curve; if the number of data points is less than N, pad with zeros. The completed data points are reorganized into a feature matrix of dimension H×W×C; The original curve data contains two-dimensional coordinates, with a total data volume of N×2, and the transformed matrix satisfies H×W=N×2; Where N is 800, the transformed feature matrix has a dimension of 40×40×1.
[0033] Specifically, the model uses only curve data. To ensure data consistency and standardization, the processing procedure is as follows: Extract the first N data points of each curve (N is 800 in this example). If a curve has fewer than 800 points, pad it with 0. After processing, the dimension of each curve becomes 800×2 (each row represents a data point, and the two columns correspond to the feature values of different dimensions).
[0034] The 800×2 vector is reshaped into a feature matrix of dimension 40×40×1 (because 40×40=1600=800×2), and the values are normalized to the range [-1, 1]. This allows one-dimensional time-series data to be adapted to the spatial feature extraction capabilities of convolutional neural networks.
[0035] Step S3 Intelligent Feature Recognition: The processed model input feature map is input into a pre-trained deep residual network model, which extracts the deep morphological features of the curve and outputs the quality control classification result of the curve; the quality control classification result is used to indicate whether there are anomalies in the curve and the type of anomaly; The deep residual network model in step S3 includes: Input layer: Used to receive the feature matrix after dimensionality transformation; Initial convolution stage: includes convolutional layers with a kernel size of 5×5 and max pooling layers, used for initial dimensionality reduction and feature extraction; Residual extraction stage: It contains multiple cascaded residual stages, each of which contains several bottleneck residual blocks; each bottleneck residual block contains three convolutional layers and passes gradients through skip connections. Output layer: Contains a global average pooling layer and a fully connected layer, used to output the probability of anomaly categories.
[0036] The training process of the deep residual network model employs a segmented decreasing learning rate adjustment strategy. The initial learning rate is used in the first T1 rounds of training; In the middle T2 round of training, the learning rate is adjusted to 1 / 10 of the initial learning rate; In the final T3 round of training, the learning rate is adjusted to 1 / 100 of the initial learning rate; Furthermore, during the training process, data augmentation was performed on the training samples, which included randomly stretching or compressing the vertical axis of the flow curve.
[0037] In addition, the types of abnormalities output by the model in step S3 include at least: cough, premature glottal closure, inadequate inspiration, expiratory pause, insufficient burst of power, air leakage, mouthpiece blockage, and hesitancy at the start of exhalation.
[0038] In some specific embodiments, the model building and training are illustrated as follows: Data preprocessing: The model uses only curve data. The first 800 points of each curve are taken, padded with zeros if necessary, to obtain an 800×2 vector (e.g., time-volume or volume-velocity pairs). To extract spatial features using a convolutional neural network, this vector is reshaped into a 40×40×1 tensor (40×40=1600=800×2), and the values are normalized to [-1,1].
[0039] Model architecture: such as Figure 2 As shown, an improved ResNet-50 model is used.
[0040] Input layer: 40×40×1.
[0041] Initial layer: 5×5 convolutional kernel, stride 2, output 64 channels; followed by 3×3 max pooling. Its purpose is to achieve rapid dimensionality reduction.
[0042] The residual stage consists of four stages. Each stage comprises multiple Bottleneck Blocks. The Bottleneck Blocks employ a structure of "1×1 convolution for dimensionality reduction -> 3×3 convolution for processing -> 1×1 convolution for dimensionality increase," and include shortcut connections to address the vanishing gradient problem.
[0043] Stage 1: 2 blocks, 64 output channels.
[0044] Stage 2: 2 blocks, 128 output channels.
[0045] Stage 3: 2 blocks, 256 output channels.
[0046] Stage 4: 2 blocks, 512 output channels.
[0047] Output layer: Global average pooling (GAP) followed by a fully connected layer (FC), with an output dimension of 11 (corresponding to various abnormal and normal types), and output probabilities through Softmax.
[0048] Training strategy: Adam optimizer was selected; Cross-Entropy Loss was used as the loss function; 300 training epochs were conducted. The learning rate was phased down: 1e-5 for the first 100 epochs, 1e-6 for epochs 101-200, and 1e-7 for epochs 201-300. The model parameters with the smallest validation set loss were strategically saved.
[0049] Step S4: Comprehensive quality control rating: Based on the quality control classification results, acceptable curves are selected, and the best and second-best values in the lung function index parameters are combined to calculate the quality level of the lung function report using a preset quality control rule engine. The rating logic of the quality control rule engine includes: If the number of acceptable curves is ≥3, and the difference between the best and second-best FEV1 values is <0.15L, and the difference between the best and second-best FVC values is <0.15L, it is judged as Grade A; If the number of acceptable curves is ≥3, and at least one of the differences between the best and second-best values of FEV1 and FVC is <0.2L, it is judged as Grade B; If the number of acceptable curves is ≥2, and at least one of the differences between the best and second-best values of FEV1 and FVC is <0.25L, it is judged as Grade C; If the number of acceptable curves is ≥2 but does not meet the C-level standard, or if the number of acceptable curves is 1, it is judged as D-level; If the number of acceptable curves is 0, it is judged as Grade F; Among them, FEV1 is the forced expiratory volume in one second, and FVC is the forced vital capacity.
[0050] Furthermore, in some specific embodiments, the model classifies the curves from a single test as "acceptable" or "unacceptable (and for specific reasons)." The system counts the number of "acceptable curves" in a single check and, combined with the difference between the best and second-best values (i.e., the two largest values) of FEV1 and FVC, rates them according to the following rules: Grade A: Acceptable curves ≥ 3, with ΔFEV1 < 0.15L and ΔFVC < 0.15.
[0051] Grade B: Acceptable curves ≥ 3, and ΔFEV1 < 0.2L or ΔFVC < 0.2L.
[0052] Grade C: Acceptable curves ≥ 2, and ΔFEV1 < 0.25L or ΔFVC < 0.25L.
[0053] Grade D: ≥2 acceptable curves but not meeting Grade C standards, or 1 acceptable curve.
[0054] Grade F: 0 acceptable curves.
[0055] Step S5 Output: The output includes an automated quality control report containing anomaly type information and quality level.
[0056] Web interface: Supports uploading PDF files exported from pulmonary function testing equipment (Jaeger pulmonary function testing equipment only), automatically parses and provides quality control results. For example, the web interface can output a quality control report, indicating the specific type of abnormality (e.g., "coughing occurred on the second breath") and providing the final AF rating.
[0057] Furthermore, in some specific embodiments, such as Figure 3 and 4 As shown, the improved ResNet-50 model structure is constructed as follows. Figure 2 As shown, the details are as follows: Input layer Input dimensions: 40×40×1 (dimensional transformation of the lung function volume-time curve and flow rate-volume curve).
[0058] Preprocessing: Normalize the values to the range [-1, 1].
[0059] initial convolutional layer Convolution kernel: 5×5, stride = 2, number of output channels = 64.
[0060] Activation function: ReLU.
[0061] Pooling layer: 3×3 max pooling, stride=2, output size reduced to 11×11×64.
[0062] Function: Quickly reduce spatial dimensionality and extract low-level features.
[0063] residual stage The core of ResNet-50 consists of four residual stages, each containing multiple Bottleneck Blocks. Each Bottleneck Block contains three convolutional layers, reducing the number of parameters through a "dimensionality reduction-convolution-upgrading" structure, while passing gradients through residual connections.
[0064] Residual block 1 Number of Bottleneck Blocks: 2.
[0065] Structure of each residual block: 3×3 convolution: Number of input channels = 64 → Number of output channels = 64.
[0066] 3×3 convolution: Number of input channels = 64 → Number of output channels = 64.
[0067] Activation function: ReLU.
[0068] Output dimensions: 11×11×64.
[0069] Residual block 2 Number of Bottleneck Blocks: 2.
[0070] The first residual block structure: 3×3 convolution: Number of input channels = 64 → Number of output channels = 64.
[0071] 3×3 convolution: Number of input channels = 64 → Number of output channels = 128.
[0072] Activation function: ReLU.
[0073] The second residual block structure: 3×3 convolution: Number of input channels = 128 → Number of output channels = 128.
[0074] 3×3 convolution: Number of input channels = 128 → Number of output channels = 128.
[0075] Activation function: ReLU.
[0076] Final output size: 6×6×128.
[0077] Residual block 3 Number of Bottleneck Blocks: 2.
[0078] The first residual block structure: 3×3 convolution: Number of input channels = 128 → Number of output channels = 128.
[0079] 3×3 convolution: Number of input channels = 128 → Number of output channels = 256.
[0080] 1×1 convolution: Number of input channels = 256 → Number of output channels = 256.
[0081] Activation function: ReLU.
[0082] The second residual block structure: 3×3 convolution: Number of input channels = 256 → Number of output channels = 256.
[0083] 3×3 convolution: Number of input channels = 256 → Number of output channels = 256.
[0084] 1×1 convolution: Number of input channels = 256 → Number of output channels = 256.
[0085] Activation function: ReLU.
[0086] Final output size: 3×3×256.
[0087] Residual block 4 Number of Bottleneck Blocks: 2.
[0088] The first residual block structure: 3×3 convolution: Number of input channels = 256 → Number of output channels = 256.
[0089] 3×3 convolution: Number of input channels = 256 → Number of output channels = 512.
[0090] 1×1 convolution: Number of input channels = 512 → Number of output channels = 512.
[0091] Activation function: ReLU.
[0092] The second residual block structure: 3×3 convolution: Number of input channels = 512 → Number of output channels = 512.
[0093] 3×3 convolution: Number of input channels = 512 → Number of output channels = 512.
[0094] 1×1 convolution: Number of input channels = 512 → Number of output channels = 512.
[0095] Activation function: ReLU.
[0096] Final output size: 2×2×512.
[0097] Output layer Global Average Pooling (GAP): Compresses 2×2×256 features into a 1×1×256 vector.
[0098] Fully connected layer (FC): The pooling result is flattened. The fully connected layer has 512 input channels and 11 output channels (corresponding to 11 types of abnormalities such as cough and premature glottal closure), and is connected to the Softmax activation function.
[0099] Training process After completing the initial data collection and preliminary processing, the model training phase officially begins. The training process primarily focuses on curve data, aiming to enable the model to learn effective features and patterns from this data through a series of carefully designed steps, thereby achieving accurate predictions of the target task.
[0100] Data preprocessing The training process only requires curve data. To ensure data consistency and standardization so that it can be smoothly input into the model for training, we processed the data obtained from step (1.5) as follows: First, for each curve data, we extract its first 800 points. If a curve has fewer than 800 points, we pad it with zeros to maintain data dimensionality consistency. After this step, the dimensions of each curve data become 800×2, where each row represents a data point, and the two columns correspond to the feature values of that point in different dimensions (e.g., the x and y coordinates in a two-dimensional coordinate system).
[0101] However, the model's input layer requires data with a dimension of 40×40×1. Here, "40×40×1" has a specific meaning: the first two dimensions, 40×40, represent the spatial size of the data, similar to the width and height of an image; while the last dimension, 1, represents the number of channels. For the curve data we are processing, it is similar to single-channel image data, so the number of channels is naturally 1. Therefore, we need to further convert the 800×2-dimensional data into a 40×40×1 dimension.
[0102] Model instance construction After data preprocessing, the next step is to build model instances and train them. The success of model training largely depends on the proper setting of a series of hyperparameters, the selection of the optimizer, and the determination of the loss function. The following are the details of model instance construction in this project: Initial learning rate setting: We set the initial learning rate to 0.00001. This value can ensure stable convergence of the model while making the training process efficient.
[0103] Learning epochs: The number of learning epochs refers to the number of times the model fully traverses the entire training dataset. Too few epochs may prevent the model from fully learning the features and patterns in the data, leading to poor performance; while too many epochs may cause overfitting, meaning the model performs well on the training data but degrades on new test data. Considering both the model's complexity and the size of the dataset, we set the number of learning epochs to 300 to ensure the model can learn sufficiently and achieve good generalization ability.
[0104] Optimizer Selection: The optimizer's role is to automatically adjust the model's parameters during training based on feedback from the loss function, continuously reducing the loss function value and thus improving model performance. In this project, we chose the torch.optim.Adam optimizer. The Adam optimizer combines the advantages of momentum gradient descent and adaptive learning rate, enabling it to adaptively adjust the learning rate across different parameters, making the model more stable and efficient during training. It converges quickly to the optimal solution and performs exceptionally well in handling non-stationary objective functions and sparse gradients, making it ideal for model training in this project.
[0105] Loss Function Determination: Since this project is a classification task, requiring the input curve data to be classified into different categories, we chose the Cross-Entropy Loss function as the loss function. The Cross-Entropy Loss function is a widely used loss function in classification tasks, possessing intuitive mathematical meaning and favorable properties.
[0106] Learning Rate Adjustment Strategy: To further improve the model's training performance and convergence speed, we adopted a segmented decreasing learning rate adjustment strategy. Specifically, in the first 100 rounds of training, we used an initial learning rate of 0.00001 to allow the model to quickly learn the general features and patterns in the data. In the middle 100 rounds (rounds 101-200), we reduced the learning rate by a factor of 10, i.e., using the initial learning rate divided by 10 (0.000001). This reduction in the learning rate allows the model to finely adjust parameters based on what it has already learned, further optimizing the model's performance. In the final 100 rounds (rounds 201-300), we reduced the learning rate by a factor of 10 again, i.e., using the initial learning rate divided by 100 (0.0000001). This extremely small learning rate in this stage allows the model to perform a more detailed search in the region close to the optimal solution, ensuring that the model can converge to or near the global optimum.
[0107] Model Saving Strategy: During training, to prevent the loss of trained model parameters due to unexpected events (such as program crashes or power outages), and to ensure the optimal-performing model is selected for subsequent applications, we employ a strategy of recording the minimum loss value and saving the corresponding parameters. Specifically, after each training round, we calculate the current model's loss value on the validation set and compare it with the previously recorded minimum loss value. If the current loss value is less than the minimum loss value, we update the minimum loss value and save the current model's parameters as a model file. Thus, after training, the resulting model file represents the optimal-performing model throughout the entire training process, which can be directly used in practical applications, providing reliable support for subsequent predictions and decision-making.
[0108] In summary, the solution proposed in this invention can integrate data such as flow rate curves and pulmonary function parameters during the testing process, automatically perform quality control rating on pulmonary function reports, and indicate whether the FV curves and VT curves blown out by the patient during pulmonary function testing meet the standard requirements, as well as the reasons for non-compliance.
[0109] The second aspect of this invention discloses an automated quality control system for lung function reporting based on AI algorithms. Figure 5 This is a structural diagram of an automated quality control system for lung function reporting based on an AI algorithm, according to an embodiment of the present invention; Figure 5 As shown, the system 100 includes: Data acquisition module 101: used to acquire raw test data from pulmonary function testing equipment, PDF reports or cloud platforms; this module is the data acquisition interface, used to connect to pulmonary function instruments from different manufacturers.
[0110] Preprocessing module 102: used to extract curve data, truncate or complete it to a fixed length, and then reshape it into a two-dimensional feature matrix; specifically, it performs the above-mentioned 800-point truncation and 40×40 matrix transformation.
[0111] AI Inference Module 103: Deploys a pre-trained deep residual network model to perform convolution operations on the two-dimensional feature matrix, identify the morphological features of the curve, and determine whether there are operational anomalies; specifically, it executes and loads the weights of the pre-trained ResNet model to perform real-time inference on the uploaded data.
[0112] Rule calculation module 104: used to generate quality control ratings based on the number of acceptable curves and the repeatability differences of lung function indicators determined by the AI inference module, according to preset standards; used to execute AF grading logic; Interactive display module 105: Used to display quality control rating results, causes of abnormalities, and original curves. Specifically used in the user interface (Web): Doctors upload PDFs or data files, and the system automatically displays the quality control level, the specific location of abnormal curves, and improvement suggestions.
[0113] This invention achieves a groundbreaking innovation in the field of pulmonary function quality control. The application layer integrates a self-developed algorithm model that accurately extracts flow-volume curve features and combines them with key indicators such as FVC and FEV1 for intelligent analysis through a dynamically adjustable quality control rule engine. It can quickly and automatically generate structured quality control results including anomaly localization and grading, accurately identifying problems such as incomplete exhalation, improving quality control efficiency and accuracy, and reducing human error. Furthermore, it supports flexible rule updates and historical quality control traceability, providing clinicians with an efficient, objective, interpretable, and traceable pulmonary function testing quality control solution.
[0114] A third aspect of this invention discloses an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the automated quality control method for lung function reports based on AI algorithms, as disclosed in any of the first aspects of this invention.
[0115] Figure 6 This is a structural diagram of an electronic device according to an embodiment of the present invention, such as... Figure 6 As shown, the electronic device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, Near Field Communication (NFC), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0116] Those skilled in the art will understand that Figure 6 The structure shown is merely a structural diagram of the part related to the technical solution of this disclosure and does not constitute a limitation on the electronic device to which the solution of this application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0117] A fourth aspect of this invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the automated quality control method for lung function reporting based on an AI algorithm, as disclosed in any of the first aspects of this invention.
[0118] Please note that the technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be pointed out that for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
[0119] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An automated quality control method for lung function reporting based on AI algorithms, characterized in that, The method includes the following steps: Step S1: Data Acquisition and Analysis: Acquire raw data from lung function tests, including basic information of the subject, lung function index parameters, and curve data; the curve data includes flow-volume curve data and / or volume-time curve data. Step S2 Data Preprocessing: Normalize and transform the curve data to convert one-dimensional time series or coordinate point data into two-dimensional matrix data to construct the model input feature map; Step S3 Intelligent Feature Recognition: The processed model input feature map is input into a pre-trained deep residual network model, which extracts the deep morphological features of the curve and outputs the quality control classification result of the curve; the quality control classification result is used to indicate whether there are anomalies in the curve and the type of anomaly; Step S4: Comprehensive quality control rating: Based on the quality control classification results, acceptable curves are selected, and the best and second-best values in the lung function index parameters are combined to calculate the quality level of the lung function report using a preset quality control rule engine. Step S5 Output: The output includes an automated quality control report containing anomaly type information and quality level.
2. The method according to claim 1, characterized in that, In step S2, the specific process of converting one-dimensional time series or coordinate point data into two-dimensional matrix data is as follows: Extract the first N data points of each curve; if the number of data points is less than N, pad with zeros. The completed data points are reorganized into a feature matrix of dimension H×W×C; The original curve data contains two-dimensional coordinates, with a total data volume of N×2, and the transformed matrix satisfies H×W=N×2; Where N is 800, the transformed feature matrix has a dimension of 40×40×1.
3. The method according to claim 1, characterized in that, The deep residual network model in step S3 includes: Input layer: Used to receive the feature matrix after dimensionality transformation; Initial convolution stage: includes convolutional layers with a kernel size of 5×5 and max pooling layers, used for initial dimensionality reduction and feature extraction; Residual extraction stage: It contains multiple cascaded residual stages, each residual stage contains several bottleneck residual blocks; each bottleneck residual block contains three convolutional layers and passes gradients through skip connections. Output layer: Contains a global average pooling layer and a fully connected layer, used to output the probability of anomaly categories.
4. The method according to claim 3, characterized in that, The training process of the deep residual network model employs a segmented decreasing learning rate adjustment strategy: The initial learning rate is used in the first T1 rounds of training; In the middle T2 round of training, the learning rate is adjusted to 1 / 10 of the initial learning rate; In the final T3 round of training, the learning rate is adjusted to 1 / 100 of the initial learning rate; Furthermore, during the training process, data augmentation was performed on the training samples, which included randomly stretching or compressing the vertical axis of the flow curve.
5. The method according to claim 1, characterized in that, The abnormal types output by the model in step S3 include at least: cough, premature glottal closure, inadequate inspiration, expiratory pause, insufficient burst power, air leakage, mouthpiece blockage, and hesitancy at the start of exhalation.
6. The method according to claim 1, characterized in that, In step S4, the rating logic of the quality control rule engine includes: If the number of acceptable curves is ≥3, and the difference between the best and second-best FEV1 values is <0.15L, and the difference between the best and second-best FVC values is <0.15L, it is judged as Grade A; If the number of acceptable curves is ≥3, and at least one of the differences between the best and second-best values of FEV1 and FVC is <0.2L, it is judged as Grade B; If the number of acceptable curves is ≥2, and at least one of the differences between the best and second-best values of FEV1 and FVC is <0.25L, it is judged as Grade C; If the number of acceptable curves is ≥2 but does not meet the C-level standard, or if the number of acceptable curves is 1, it is judged as D-level; If the number of acceptable curves is 0, it is judged as Grade F; Among them, FEV1 is the forced expiratory volume in one second, and FVC is the forced vital capacity.
7. An automated quality control system for lung function reporting based on AI algorithms, characterized in that, include: Data acquisition module: used to acquire raw test data from lung function testing equipment, PDF reports, or cloud platforms; Preprocessing module: used to extract curve data, truncate or pad it to a fixed length, and then reshape it into a two-dimensional feature matrix; AI inference module: Deployed with a pre-trained deep residual network model, used to perform convolution operations on the two-dimensional feature matrix, identify the morphological features of the curve, and determine whether there are any operational anomalies. Rule calculation module: Used to generate quality control ratings based on the number of acceptable curves and the repeatability differences of lung function indicators determined by the AI inference module, according to preset standards. Interactive display module: used to display quality control rating results, causes of anomalies, and original curves.
8. The system according to claim 7, characterized in that, The deep residual network model in the AI inference module contains four residual stages. The bottleneck residual block of each stage is composed of a structure of 1×1 convolution dimensionality reduction, 3×3 convolution processing and 1×1 convolution dimensionality increase.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the steps of the automated quality control method for lung function reporting based on an AI algorithm, as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the automated quality control method for lung function reporting based on an AI algorithm, as described in any one of claims 1 to 6.