Ventilator mask recognition method, system and device based on transfer learning

By employing a transfer learning-based approach, utilizing a five-level cascaded convolutional neural network and isomorphic transductive transfer learning, the problems of low intelligence and high computational complexity in ventilator mask recognition were solved, achieving efficient and accurate mask type recognition in ventilator embedded systems.

CN122333200APending Publication Date: 2026-07-03XIANGTAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610450922.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-08
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing ventilator mask recognition technologies rely on manual verification and have low levels of intelligence. Deep learning models have a large number of parameters and high computational complexity, making them difficult to deploy in ventilator embedded systems with limited computing power and power consumption. They cannot meet the requirements for real-time recognition, and traditional transfer learning methods have failed to optimize for the temporal characteristics of respiratory signals and hardware constraints.

Method used

A transfer learning-based approach is adopted to construct two-dimensional time-series features by collecting respiratory flow and pressure time-series data. A five-level cascaded convolutional neural network is used for feature extraction and classification. Combined with an isomorphic transductive transfer learning strategy, the marginal distribution difference between the source and target domain data is reduced, making it suitable for home ventilator embedded systems.

Benefits of technology

It achieves highly accurate mask type recognition under different patient wearing habits or hardware differences, adapts to ventilator embedded systems with limited computing power, ensures recognition performance and real-time performance, and improves the accuracy and stability of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122333200A_ABST
    Figure CN122333200A_ABST
Patent Text Reader

Abstract

This application provides a method, system, and device for ventilator mask recognition based on transfer learning. The method collects time-series data of respiratory flow and pressure using flow and pressure sensors inside a home ventilator; a data preprocessing module cleans the time-series data to obtain high-quality respiratory flow and pressure time-series data; a data segmentation module divides the preprocessed time-series data into discrete flow and pressure data segments; a transfer learning module transfers the parameters of the source model to the target model, and the target model is trained and fine-tuned using the segmented discrete flow and pressure data segments to obtain the final mask type recognition model. The final mask type recognition model can accurately predict the ventilator mask type based on respiratory flow and pressure signals. This application utilizes transfer learning to improve the robustness of the model to mask type recognition across individuals and devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of transfer learning technology, and in particular to a method, system and device for ventilator mask recognition based on transfer learning. Background Technology

[0002] With the widespread use of home ventilators in the treatment and rehabilitation of respiratory diseases, the mask, as a key component connecting the patient and the device, directly impacts treatment effectiveness and safety through its selection and wearing quality. Different types of masks differ in structural design and sealing performance. If the mask type does not match the ventilation parameters set by the ventilator, it can easily lead to problems such as air leakage and unstable pressure fluctuations, not only reducing treatment efficiency but also potentially posing medical safety risks to the patient. Therefore, achieving automatic and accurate identification of mask types in home ventilators has become a core element in promoting intelligent and personalized medical treatment.

[0003] In related technologies, the identification of ventilator masks mainly relies on manual verification and data entry, which has a low level of intelligence and is prone to errors. Although identification technologies based on intelligent sensing and deep learning have begun to be researched, they still face many challenges in practical applications: existing deep learning models often have a large number of parameters and high computational complexity, making them difficult to deploy in ventilator embedded systems with limited computing power and power consumption, and thus unable to meet the requirements of real-time identification. Summary of the Invention

[0004] In view of this, it is necessary to provide a ventilator mask recognition method, system and device based on transfer learning, which can at least overcome one of the above defects.

[0005] In a first aspect, embodiments of this application provide a ventilator mask recognition method based on transfer learning, the method comprising:

[0006] Collect time-series data of respiratory flow and respiratory pressure under normal ventilation conditions of the ventilator, and construct two-dimensional time-series feature data based on the respiratory flow and respiratory pressure;

[0007] The two-dimensional time series data is divided into discrete sample segments by using a fixed window overlapping sliding method;

[0008] The discrete sample fragments are input into a two-dimensional convolutional recognition model for feature extraction.

[0009] An isomorphic transductive transfer learning strategy is adopted to pre-train the two-dimensional convolutional recognition model, and the parameters of the pre-trained model are transferred to the target model.

[0010] The discrete sample fragments are used to fine-tune the target model, reducing the difference in marginal distribution between the source and target domain data.

[0011] The identification result of the ventilator mask type is determined by the classification probability output by the target model.

[0012] In one embodiment, the two-dimensional convolutional recognition model applies a five-level cascaded architecture;

[0013] The two-dimensional convolutional recognition model includes: a convolutional feature extraction module for initially extracting flow and pressure features; a multi-dimensional attention enhancement module for enhancing key features; a shallow and deep feature fusion module for aligning details and semantic information; a dual-path adaptive pooling feature aggregation module for feature compression and aggregation; and a residual classification head module for outputting classification results.

[0014] In one embodiment, the convolutional feature extraction module includes multiple basic convolutional units, each of which includes an adaptive equal-width padding layer, a grouped dilated convolutional layer, a batch normalization layer, a nonlinear activation layer, a temporal dimension downsampling layer, and a random deactivation layer; wherein, the grouped dilated convolutional layer achieves lightweighting by adaptively adjusting the number of groups, and expands the convolutional receptive field by using the dilation rate to capture long-range temporal features.

[0015] In one embodiment, the multi-dimensional attention enhancement module includes three parallel attention branches: a channel attention branch, a temporal attention branch, and a cross-channel attention branch. The channel attention branch focuses on important channel features through global average pooling, the temporal attention branch extracts temporal dependencies in the width dimension, and the cross-channel attention branch models spatial interaction relationships in the height dimension. Feature enhancement is achieved by multiplying the weight matrices generated by the three branches element-wise with the original feature map.

[0016] In one embodiment, the feature fusion module is used to fuse shallow and deep features of the model:

[0017] The shallow features output by the second basic unit in the convolutional feature extraction module are pooled to the same spatial dimension as the deep features output by the multi-dimensional attention module by an adaptive average pooling layer.

[0018] After concatenating the channels, a 1x1 convolutional layer is used for dimensionality reduction and fusion to extract detailed information and abstract semantics of the features.

[0019] In one embodiment, the residual classification head module is disposed at the end of the two-dimensional convolutional recognition model;

[0020] The residual classification head module employs a three-level fully connected layer serial architecture and introduces residual connections between layers to gradually reduce the feature dimension and map to the final classification space.

[0021] In one embodiment, the residual classification head module includes:

[0022] The first fully connected layer is used to map the input features to the first intermediate dimension and perform random deactivation processing;

[0023] The second fully connected layer is used to map the features to the second intermediate dimension and add and fuse them with the feature output from the residual branch;

[0024] The third fully connected layer maps the fused features to the same dimension as the number of preset mask types, and outputs the classification prediction results.

[0025] In one embodiment, the two-dimensional convolutional recognition model further includes a dual-path adaptive pooling feature aggregation module;

[0026] The dual-path adaptive pooling feature aggregation module adopts a parallel pooling architecture, which uses a global adaptive average pooling layer to aggregate global spatial and temporal features, while using a temporal adaptive average pooling layer to retain local features in the temporal dimension.

[0027] The two pooling results are concatenated and then the feature dimension is unified through an adaptive one-dimensional pooling layer to fix the input dimension of the classification head.

[0028] Secondly, one embodiment of this application provides a ventilator mask recognition system based on transfer learning, applied to implement the ventilator mask recognition method based on transfer learning as described in the first aspect, the system comprising:

[0029] The information acquisition module is used to acquire time-series data of respiratory flow and respiratory pressure of the ventilator under normal ventilation conditions, and to construct two-dimensional time-series feature data based on the respiratory flow and respiratory pressure.

[0030] The data processing module uses a fixed window overlapping sliding method to divide the two-dimensional time series data into discrete sample segments; inputs the discrete sample segments into a two-dimensional convolutional recognition model for feature extraction; and uses an isomorphic transductive transfer learning strategy to pre-train the two-dimensional convolutional recognition model and transfer the pre-trained model parameters to the target model.

[0031] The model adjustment module applies the discrete sample fragments to fine-tune the target model, reducing the difference in marginal distribution between the source domain and the target domain data.

[0032] The target model is used to output classification probabilities to determine the identification result of the ventilator mask type.

[0033] Thirdly, embodiments of this application provide an electronic device, including:

[0034] Processor; and

[0035] A memory having computer-readable instructions stored thereon for controlling the processor to execute the ventilator mask recognition method based on transfer learning as described in the first aspect.

[0036] This application provides a ventilator mask recognition method, system, and device based on transfer learning. By employing an isomorphic direct transfer learning strategy, it utilizes a large-scale pre-trained model to deeply mine the common patterns of respiratory signals, effectively solving the problem of insufficient samples for specific individuals or new devices. This approach reduces the distribution difference between the source and target domains, enabling the model to maintain high accuracy in mask type recognition even when faced with different patient wearing habits or different hardware. Attached Figure Description

[0037] Figure 1 This is a schematic flowchart of a ventilator mask recognition method based on transfer learning provided in an embodiment of this application.

[0038] Figure 2 A schematic diagram of a ventilator mask recognition system based on transfer learning is provided for one embodiment of this application.

[0039] Figure 3 This is a schematic diagram of the modules of an electronic device provided in an embodiment of this application.

[0040] Explanation of main component symbols

[0041] Detailed Implementation

[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them.

[0043] It should be noted that, in the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.

[0044] It should be noted that in the embodiments of this application, the terms "first," "second," etc., are used only for descriptive purposes and should not be construed as indicating or implying relative importance, nor as indicating or implying order. Features specified as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0045] Based on the embodiments described in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] With the widespread use of home ventilators in the treatment and rehabilitation of respiratory diseases, the mask, as a key component connecting the patient and the device, directly impacts treatment effectiveness and safety through its selection and wearing quality. Different types of masks differ in structural design and sealing performance. If the mask type does not match the ventilation parameters set by the ventilator, it can easily lead to problems such as air leakage and unstable pressure fluctuations, not only reducing treatment efficiency but also potentially posing medical safety risks to the patient. Therefore, achieving automatic and accurate identification of mask types in home ventilators has become a core element in promoting intelligent and personalized medical treatment.

[0047] In related technologies, the identification of ventilator masks mainly relies on manual verification and data entry, which has a low level of intelligence and is prone to errors. Although identification technologies based on intelligent sensing and deep learning have begun to be researched, they still face many challenges in practical applications: First, the variety of mask types and the subtle differences in some features, coupled with the fact that respiratory flow and pressure data are easily affected by environmental factors such as tightness of the mask and respiratory status, result in models that are highly dependent on large-scale labeled samples and lack robustness; second, existing deep learning models often have a large number of parameters and high computational complexity, making them difficult to deploy in ventilator embedded systems with limited computing power and power consumption, and thus unable to meet the requirements of real-time identification; in addition, traditional transfer learning methods have not been specifically optimized for the temporal characteristics of respiratory signals and hardware constraints, making it difficult to balance identification accuracy and deployment performance.

[0048] In view of this, the ventilator mask recognition method, system, and device based on transfer learning provided in this application effectively solves the problem of insufficient samples for specific individuals or new devices by employing an isomorphic direct transfer learning strategy and utilizing a large-scale pre-trained model to deeply mine the common patterns of respiratory signals. This approach reduces the distribution difference between the source and target domains, enabling the model to maintain high accuracy in mask type recognition even when faced with different patient wearing habits or hardware differences. The five-level cascaded convolutional neural network constructed in this solution utilizes grouped dilated convolution to significantly reduce the number of parameters and computational complexity while effectively expanding the receptive field to capture long-term respiratory signal features. This design not only ensures recognition performance but also perfectly adapts to the hardware environment of home ventilator embedded systems with limited computing power and stringent power consumption requirements. Furthermore, feature extraction is more comprehensive and refined. Through a multi-dimensional attention enhancement module and deep and shallow feature fusion design, the system can weight and enhance key respiratory features from multiple dimensions such as channel weights, temporal dependencies, and spatial interactions, while taking into account both the detailed information and abstract semantics of the signal. Combined with dual-path adaptive pooling and residual connection techniques, the comprehensiveness of feature aggregation is further enhanced, and the gradient vanishing problem of deep networks is effectively alleviated, ensuring the real-time performance and stability of the recognition process.

[0049] Figure 1 This application provides an embodiment of a ventilator mask recognition method based on transfer learning, such as... Figure 1 The ventilator mask recognition method based on transfer learning, as shown, includes at least the following steps: S100: Collect time-series data of respiratory flow and respiratory pressure of the ventilator under normal ventilation conditions, and construct two-dimensional time-series feature data based on respiratory flow and respiratory pressure; S200: Divide the two-dimensional time-series data into discrete sample segments using a fixed window overlapping sliding method; S300: Input the discrete sample segments into a two-dimensional convolutional recognition model for feature extraction; S400: Pre-train the two-dimensional convolutional recognition model using an isomorphic direct transfer learning strategy, and transfer the pre-trained model parameters to the target model; S500: Fine-tune the target model using discrete sample segments to reduce the difference in edge distribution between the source and target domain data; S600: Determine the recognition result of the ventilator mask type based on the classification probability output by the target model.

[0050] S100: Collects time-series data of respiratory flow and respiratory pressure under normal ventilation conditions of the ventilator, and constructs two-dimensional time-series feature data based on respiratory flow and respiratory pressure.

[0051] In this embodiment of the application, the ventilator mask recognition method based on transfer learning includes collecting time-series data of respiratory flow and respiratory pressure of the ventilator under normal ventilation conditions in step S100, and constructing two-dimensional time-series feature data based on respiratory flow and respiratory pressure.

[0052] Specifically, flow and pressure signals during ventilation are synchronously acquired by flow and pressure sensors installed inside the ventilator. These two types of signals are then time-aligned according to a preset sampling frequency to form dual-channel time-series data that matches each corresponding moment. Furthermore, the flow and pressure signals are combined sequentially according to the sampling points to construct two-dimensional time-series feature data. One dimension characterizes different sensor channels, and the other dimension characterizes the respiratory waveform that changes over time.

[0053] It is understandable that, due to the differences in structural sealing, airflow resistance, and pressure feedback characteristics of different types of masks, the flow and pressure time-series data collected under normal ventilation conditions will exhibit different waveform patterns and dynamic change patterns, which can provide an effective raw input basis for subsequent mask type identification.

[0054] S200: Two-dimensional time series data is divided into discrete sample segments by using a fixed window overlapping sliding method.

[0055] In this embodiment of the application, the ventilator mask recognition method based on transfer learning includes dividing two-dimensional time series data into discrete sample segments by using a fixed window overlapping sliding method in step S200.

[0056] Specifically, a preset window length is used to slide backwards on the two-dimensional time-series data with a fixed step size, extracting the flow and pressure data within the coverage area of ​​each window into a discrete sample segment. The window length ensures that each sample segment contains complete local respiratory change information, while the sliding step size or overlap ratio controls the continuity and number of samples between adjacent samples. Furthermore, the window length and overlap ratio can be set according to respiratory cycle characteristics to ensure that the segmented samples retain local dynamic information while avoiding the loss of contextual information due to overly fragmented segmentation.

[0057] Understandably, using a fixed window overlapping sliding method can transform continuous respiratory time-series signals into multiple structurally consistent local samples, which facilitates subsequent batch training and feature learning of the model. At the same time, the overlap of samples enhances the correlation between adjacent samples, which is beneficial to improving the model's ability to perceive details of respiratory changes and its recognition stability.

[0058] S300: Input discrete sample fragments into a two-dimensional convolutional recognition model for feature extraction.

[0059] In this embodiment of the application, the ventilator mask recognition method based on transfer learning includes inputting discrete sample fragments into a two-dimensional convolutional recognition model for feature extraction in step S200.

[0060] Specifically, the discrete sample fragments obtained in step S200 are used as input to the two-dimensional convolutional recognition model. The convolutional feature extraction module in the model encodes the flow and pressure time series features layer by layer, extracting local waveform change features, time series evolution features, and inter-channel correlation features. Subsequently, the key features are enhanced by the attention enhancement module, and the shallow and deep feature fusion module retains detailed information and abstract semantic information, ultimately forming a more discriminative high-dimensional feature representation.

[0061] Understandably, the two-dimensional convolutional recognition model can simultaneously process two-dimensional structural information of flow and pressure. Compared with the method of modeling only a single time-series signal, it is more conducive to capturing the joint waveform changes caused by differences in mask type, thereby improving the accuracy and robustness of subsequent classification and recognition.

[0062] S400: It adopts a homogeneous transductive transfer learning strategy to pre-train a two-dimensional convolutional recognition model and then transfers the parameters of the pre-trained model to the target model.

[0063] In this embodiment of the application, the ventilator mask recognition method based on transfer learning includes step S400, which involves using an isomorphic transductive transfer learning strategy to pre-train a two-dimensional convolutional recognition model and then transferring the pre-trained model parameters to the target model.

[0064] Specifically, large-scale respiratory flow and pressure data that are consistent with the target task in terms of input structure and model form are selected as source domain data to pre-train the two-dimensional convolutional recognition model, so that the model first learns the general respiratory waveform representation rules and feature extraction capabilities; then, the model parameters obtained in the pre-training stage are completely transferred to the target model, so that the target model inherits the basic feature expression capabilities already learned by the source model.

[0065] It is understandable that, since the source domain and the target domain are isomorphic in the feature space, the pre-trained parameters can be directly reused using the transductive transfer method, which reduces the target task's dependence on a large number of labeled samples and reduces the convergence difficulties and overfitting risks brought about by training from scratch, thereby improving the model's training efficiency and generalization performance.

[0066] S500: Uses discrete sample fragments to fine-tune the target model, reducing the difference in marginal distribution between the source and target domain data.

[0067] In this embodiment of the application, the ventilator mask recognition method based on transfer learning includes step S500, which involves fine-tuning the target model using discrete sample fragments to reduce the difference in edge distribution between the source domain and the target domain data.

[0068] Specifically, discrete sample fragments collected from specific users or devices are input into the target model. While retaining the existing feature extraction capabilities of the pre-trained model, the model parameters are updated in a targeted manner to adapt the model to the data distribution of mask types in the target scenario. During the fine-tuning process, differentiated training strategies can be set for different levels of the model according to the target data scale to enhance the sensitivity to the features of the target mask while maintaining general features.

[0069] Understandably, while the pre-trained model already possesses a strong ability to represent general respiratory signals, differences in breathing habits, tightness of the mask, and device variations among different users can cause data distribution shifts. Therefore, fine-tuning the training can further reduce the distribution differences between the source and target domains, making the model more suitable for specific application scenarios and improving the accuracy and stability of mask recognition.

[0070] S600: The identification result of the ventilator mask type is determined by the classification probability output by the target model.

[0071] In this embodiment of the application, the ventilator mask recognition method based on transfer learning includes, in step S600, determining the recognition result of the ventilator mask type through the classification probability output by the target model.

[0072] Specifically, the target model trained in step S500 is used in the inference stage to output the classification probability corresponding to each preset mask type, and the category with the highest probability value is taken as the recognition result of the current ventilator mask; furthermore, the recognition result can be used for mask type display, wearing status confirmation and subsequent adaptive adjustment of ventilation parameters.

[0073] Understandably, outputting classification probabilities instead of just a single label can more intuitively reflect the model's confidence in distinguishing each mask type, making it easier for the system to provide prompts or secondary confirmation when the recognition results are unclear, thereby improving reliability and safety in actual use.

[0074] In this embodiment, the two-dimensional convolutional recognition model employs a five-level cascaded architecture. The two-dimensional convolutional recognition model includes: a convolutional feature extraction module for initially extracting traffic and pressure features; a multi-dimensional attention enhancement module for enhancing key features; a shallow and deep feature fusion module for aligning details and semantic information; a dual-path adaptive pooling feature aggregation module for feature compression and aggregation; and a residual classification head module for outputting classification results.

[0075] Specifically, the two-dimensional convolutional recognition model takes two-dimensional temporal feature data composed of respiratory flow and respiratory pressure as input. First, the convolutional feature extraction module performs basic encoding on local waveforms, temporal changes, and channel correlations. Then, the multi-dimensional attention enhancement module weights and strengthens key discriminative features. Subsequently, shallow features and deep features are fused to take into account both detailed information and abstract semantic information. Then, the feature dimensions are compressed and unified by the dual-path adaptive pooling feature aggregation module. Finally, the residual classification head module outputs the classification probabilities of different mask types.

[0076] Understandably, the five-stage sequential architecture processes "local feature extraction—key feature enhancement—multi-layer feature fusion—feature compression and aggregation—classification decision" in stages, enabling the model to capture fine-grained differences in flow and pressure signals while maintaining low parameter count and computational complexity, thus making it suitable for ventilator embedded deployment scenarios. In this embodiment, the convolutional feature extraction module includes multiple basic convolutional units, each of which includes an adaptive equal-width padding layer, a grouped dilated convolutional layer, a batch normalization layer, a nonlinear activation layer, a temporal dimension downsampling layer, and a random deactivation layer; wherein, the grouped dilated convolutional layer achieves lightweighting by adaptively adjusting the number of groups and uses the dilation rate to expand the convolutional receptive field to capture long-range temporal features.

[0077] Specifically, for the input feature map ,in Indicates batch size. Indicates the number of input channels. Indicates height dimension, Representing the width dimension, the basic convolutional unit first performs boundary compensation on the input features through an adaptive equal-width padding layer to ensure that the spatial dimension of the output remains consistent after convolution; subsequently, grouped dilated convolutions are used for feature extraction, and their convolution calculation can be expressed as:

[0078]

[0079] in, For convolution output features, Indicates the number of groups is Expansion rate The convolution operation is performed. The convolution output then passes sequentially through a batch normalization layer (BN) and a nonlinear activation layer. (e.g., GELU activation function), temporal downsampling layers, and random deactivation layers (Dropout) are used to obtain the output features of the basic convolutional units. .

[0080] Understandably, this includes the number of groups. The adaptive adjustment is used to avoid dimensionality conflicts when the number of input or output channels is not divisible by the number of groups, thereby improving the model's versatility; inflation rate The convolutional kernel's receptive field is expanded, enabling the model to extract a longer range of respiratory temporal dependencies without significantly increasing the number of parameters. The temporal dimension downsampling layer compresses only the width dimension, which helps to preserve channel-related structural information in the height dimension. The random deactivation layer reduces the risk of model overfitting and improves generalization ability by randomly shielding some neurons during training.

[0081] In this embodiment, the multi-dimensional attention enhancement module includes three parallel attention branches: a channel attention branch, a temporal attention branch, and a cross-channel attention branch. The channel attention branch focuses on important channel features through global average pooling; the temporal attention branch extracts temporal dependencies in the width dimension; and the cross-channel attention branch models spatial interaction relationships in the height dimension. Feature enhancement is achieved by element-wise multiplying the weight matrices generated by the three branches with the original feature map.

[0082] Specifically, let the feature map output by the convolutional feature extraction module be... For the channel attention branch, firstly... Perform global average pooling to obtain the channel description vector. Then, a channel attention weight matrix is ​​generated through a convolutional layer and a sigmoid activation function. It can be represented as:

[0083]

[0084] in, Indicates global average pooling. This represents the Sigmoid function. Used to characterize the importance of different channels. For the temporal attention branch, first along the height dimension. Calculate the mean to obtain the time series features. Temporal weights are then generated through depthwise separable convolution, batch normalization, GELU activation, Conv1D, and Sigmoid activation. :

[0085]

[0086] in, This indicates that the mean is calculated along the height dimension. This represents depthwise separable convolution. For cross-channel attention branches, first proceed along the width dimension. Calculate the average value to obtain cross-channel features Then, through a two-dimensional fully connected mapping and the Sigmoid function, the cross-channel weights are obtained. :

[0087]

[0088] Finally, the weight matrices obtained from the three attention branches are fused and multiplied element-wise with the original feature map to obtain the enhanced feature representation. :

[0089]

[0090] in, This indicates element-wise multiplication.

[0091] Understandably, the channel attention branch is used to highlight the feature channels most sensitive to mask type and suppress redundant noise; the temporal attention branch is used to capture the dependencies between different time segments during breathing; and the cross-channel attention branch is used to characterize the interaction between different height positions. The synergistic effect of these three branches allows the model to focus on key waveform changes caused by mask differences from multiple dimensions, thereby improving feature representation and recognition accuracy.

[0092] In this embodiment, the feature fusion module is used to fuse shallow and deep features of the model: The shallow features output by the second basic unit in the convolutional feature extraction module are pooled to the same spatial dimension as the deep features output by the multi-dimensional attention module using an adaptive average pooling layer. After concatenating the channel dimensions, a 1x1 convolutional layer is used for dimensionality reduction fusion to extract detailed information and abstract semantics of the features.

[0093] Specifically, let the shallow features output by the second basic convolutional unit be... The deep features output by the multi-dimensional attention module are First, adaptive average pooling is used to... Adjusted to be with Feature maps with the same spatial dimensions are denoted as ; then and By concatenating along the channel dimension, the fused features are obtained. :

[0094]

[0095] in, Indicates adaptive average pooling. This indicates channel-dimensional splicing. Further, through... The convolutional layer performs channel compression and remapping on the concatenated features, and combines batch normalization and activation functions to obtain the fused output features. :

[0096]

[0097] in, This represents a non-linear activation function.

[0098] Understandably, shallow features retain detailed information such as local waveforms and edge variations, while deep features contain stronger abstract semantics and category discrimination information; merging the two can improve the model's ability to perceive subtle mask differences and enhance its ability to express complex breathing patterns. Convolutional processing for dimensionality reduction can also prevent the number of channels after feature concatenation from becoming too large, which would lead to a significant increase in the number of model parameters and computational cost, thus maintaining the model's lightweight advantage.

[0099] In this embodiment, the residual classification head module is located at the end of the two-dimensional convolutional recognition model. The residual classification head module applies a three-level fully connected layer serial architecture and introduces residual connections between layers to gradually reduce the feature dimension and map to the final classification space.

[0100] Specifically, let the feature vector output by the dual-path adaptive pooling feature aggregation module be... First, the first fully connected layer maps the input features to the first intermediate dimension. Intermediate representations were obtained by combining random deactivation processing. :

[0101]

[0102] in, and These are the weight matrix and bias term of the first fully connected layer, respectively. This is the activation function.

[0103] Subsequently, the second fully connected layer maps the features to the second intermediate dimension. And it is added and fused with the features from the residual branch to obtain :

[0104]

[0105] in, and These represent the parameters of the second fully connected layer. The linear mapping parameters representing the residual branches are used to map the input features. Align to the same dimension as the second layer output.

[0106] Finally, the third fully connected layer maps the fused features to a dimension equal to the number of preset mask types, and outputs the classification prediction result. :

[0107]

[0108] in, and These represent the weight matrix and bias term of the third fully connected layer, respectively. Input the classification score or classification probability corresponding to each mask type.

[0109] Understandably, the three-level fully connected layer adopts a stepwise dimensionality reduction approach, which helps to maintain effective discriminative information while compressing the dimension of feature representation; the introduction of residual connections can alleviate the gradient decay problem that may occur in deep classification heads during training and enhance information transmission capabilities; random deactivation can further reduce the risk of overfitting, making the final classification results more stable and reliable.

[0110] In this embodiment, the dual-path adaptive pooling feature aggregation module adopts a parallel pooling architecture to compress and aggregate data features, including a global adaptive average pooling layer, a temporal adaptive average pooling layer, and an adaptive one-dimensional pooling layer for unifying dimensions.

[0111] Specifically, one pooling branch uses global adaptive average pooling to compress the fused features into global features that can represent the overall spatial and temporal information; the other pooling branch uses temporal adaptive average pooling to retain only the local response features in the temporal dimension. Let the results of the two pooling paths be as follows: and First, flatten the two vectors and then concatenate them to obtain the feature vector. :

[0112]

[0113] Furthermore, the concatenated features are mapped to a unified dimension using an adaptive one-dimensional pooling layer to obtain a fixed-length feature vector. :

[0114]

[0115] in, Indicates the flattening operation. This represents adaptive one-dimensional pooling.

[0116] Understandably, global pooling can preserve overall breathing pattern information, while temporal pooling can enhance local waveform details. Combining the two can balance global discriminativeness and local sensitivity. Adaptive one-dimensional pooling can unify features of different input sizes into a fixed length, providing a stable input for the subsequent residual classification head, thereby improving the model's adaptability to different data segment lengths.

[0117] In this embodiment, the residual classification head module includes: a first-level fully connected layer for mapping input features to a first intermediate dimension and performing random deactivation processing; a second-level fully connected layer for mapping features to a second intermediate dimension and adding and fusing them with the feature output from the residual branch; and a third-level fully connected layer for mapping the fused features to a dimension equal to the number of preset mask types and outputting the classification prediction result.

[0118] Specifically, let the feature vector output by the dual-path adaptive pooling feature aggregation module be the input feature vector. Then the first fully connected layer can map the input features to the first intermediate features. And combined with random deactivation to reduce the risk of overfitting, it is expressed as:

[0119]

[0120] in, This is the weight matrix of the first-level fully connected layer. For bias terms, Represents a non-linear activation function. This indicates random deactivation.

[0121] Furthermore, the second-level fully connected layer will integrate the first intermediate feature. Mapped to the second intermediate dimension and added to the residual branch output, it is represented as:

[0122]

[0123] in, and These are the weight matrix and bias terms of the second-level fully connected layer, respectively. The linear mapping parameter corresponding to the residual branch is used to align dimensions and realize feature residual propagation.

[0124] Finally, the third fully connected layer maps the fused features to a dimension equal to the number of preset mask types, and outputs the classification score or classification probability for each mask type, represented as:

[0125]

[0126] in, and These are the weight matrix and bias terms of the third-level fully connected layer, respectively. This is the final classification output.

[0127] Understandably, the three-level fully connected layer adopts a step-by-step dimensionality reduction approach, which can retain effective discriminative information while compressing the dimension of feature representation; the introduction of residual branches helps to alleviate the gradient decay problem that may occur during the training of deep classification structures and enhances the ability to transmit key information; random deactivation processing can further improve the generalization performance of the model, thereby improving the stability and accuracy of mask type recognition results.

[0128] In this embodiment, the two-dimensional convolutional recognition model further includes a dual-path adaptive pooling feature aggregation module. This module employs a parallel pooling architecture, utilizing a global adaptive average pooling layer to aggregate global spatial and temporal features, while simultaneously using a temporal adaptive average pooling layer to preserve local features along the temporal dimension. The two pooling results are concatenated and then unified through an adaptive one-dimensional pooling layer to fix the input dimension of the classification head.

[0129] Specifically, let the feature map output by the fusion module be... The first branch in the dual-path adaptive pooling feature aggregation module uses global adaptive average pooling to compress the spatial and temporal dimensions of the feature map as a whole, resulting in global features. The second branch employs temporal adaptive average pooling to compress the temporal dimension of the feature map while preserving local variation features, thus obtaining local features. Subsequently, the two pooling results are flattened and concatenated along the feature dimension to obtain the concatenated features. :

[0130]

[0131] in, This indicates a splicing operation. This indicates a flattening operation. Further, regarding the spliced ​​features... Adaptive one-dimensional pooling is performed to obtain aggregated features of fixed length. :

[0132]

[0133] in, This represents an adaptive one-dimensional pooling operation.

[0134] Understandably, global adaptive average pooling can extract overall pattern information of respiratory flow and pressure signals, making it easier for the model to grasp mask type differences from a global perspective; temporal adaptive average pooling can preserve waveform details in local time segments, helping to enhance sensitivity to short-term changing features; concatenating the two features and then unifying the dimension through adaptive one-dimensional pooling can effectively eliminate feature size differences caused by different input segment lengths, enabling the classification head to obtain stable input, thereby improving the model's adaptability to different sample segments and classification robustness.

[0135] The complete workflow of the ventilator mask recognition method based on transfer learning provided in this application embodiment is described below with an exemplary embodiment. Specifically, the process begins with the ventilator's internal flow and pressure sensors simultaneously collecting time-series data on respiratory flow and pressure under normal ventilation conditions. Two-dimensional time-series feature data is then constructed based on the collected dual-channel signals. This data is preprocessed to obtain more stable and higher-quality input samples. Next, a fixed-window overlapping sliding method is used to divide the two-dimensional time-series data into multiple discrete sample segments. These discrete sample segments are then input into a two-dimensional convolutional recognition model for feature extraction. Feature encoding and classification decisions are completed step-by-step through a convolutional feature extraction module, a multi-dimensional attention enhancement module, a shallow and deep feature fusion module, a dual-path adaptive pooling feature aggregation module, and a residual classification head module. Following this, an isomorphic transductive transfer learning strategy is used to pre-train the two-dimensional convolutional recognition model, and the pre-trained model parameters are fully transferred to the target model. Finally, the target model is fine-tuned using discrete sample segments collected in the target scenario to reduce the data distribution differences between the source and target domains. The final ventilator mask type recognition result is obtained through the classification probability output by the target model. The above methodology is consistent with the overall scheme in the disclosure document regarding data acquisition, preprocessing, data segmentation, transfer learning, and model classification.

[0136] In this embodiment, the data preprocessing is used to eliminate invalid data during the respiratory transition period, correct missing and outlier values, reduce noise interference, and standardize data scale, thereby providing high-quality samples for subsequent model training. Specifically, data preprocessing includes at least invalid data processing, linear interpolation, filtering and denoising, and standardization. For invalid data processing, unrepresentative data segments during the transition period in each respiratory signal, as well as invalid data recorded during the acquisition process, can be removed to prevent the model from learning noise features unrelated to the mask type. For linear interpolation, when there are null or outlier values ​​in the data collected by the flow sensor or pressure sensor, after identifying and deleting outlier points according to a preset threshold, linear interpolation can be performed using adjacent valid data before and after the outlier point. The formula can be expressed as:

[0137]

[0138] in, The time to be interpolated The fill value, and These are the known valid data values ​​located to the left and right of the point to be interpolated, respectively. and These represent the corresponding effective times. For filtering and noise reduction, a Butterworth low-pass filter can be used to process the respiratory flow and respiratory pressure signals, and its amplitude-frequency response can be expressed as:

[0139]

[0140] in, For the filter at angular frequency Frequency response at that point, Let the filter order be . The cutoff angular frequency is used; this low-pass filter preserves the low-frequency breathing principal component and suppresses high-frequency noise. For standardization, Z-score normalization can be used to map data from different sensor channels to a uniform scale, and its formula can be expressed as:

[0141]

[0142] in, These are the original sample values. These are the standardized sample values. The sample mean. This represents the sample standard deviation.

[0143] In this embodiment, after the above data preprocessing, the noise interference and scale differences of the two-dimensional time-series feature data are effectively reduced. Therefore, a fixed-window overlapping sliding method can be used for sample segmentation to form discrete sample fragments with consistent structure. These sample fragments are then input into a lightweight two-dimensional convolutional recognition model. Grouped dilated convolution is used to jointly extract local waveforms and long-range time-series features. A multi-dimensional attention mechanism highlights key features related to mask type. Shallow and deep feature fusion takes into account both detailed and semantic information. A dual-path adaptive pooling feature aggregation module unifies feature dimensions and inputs them into a residual classification head module to complete classification. Simultaneously, by leveraging the pre-training and parameter transfer mechanisms in isomorphic transductive transfer learning, general rules can be learned from large-scale respiratory data. Fine-tuning based on the target scene reduces the difference between the source and target domains, thereby improving the model's recognition accuracy and generalization ability under different user and device conditions.

[0144] The transfer learning-based ventilator mask recognition method provided in this application collects flow and pressure time-series data under normal ventilation conditions of a ventilator and constructs it into a two-dimensional time-series feature. Combined with data preprocessing and fixed-window sliding segmentation, it effectively removes invalid data, outliers, and noise interference during the transition period, making the input model data more stable and standardized, thus laying a high-quality data foundation for subsequent recognition. Secondly, it employs a lightweight two-dimensional convolutional recognition model designed for flow-pressure two-dimensional time-series data, and introduces structures such as grouped dilated convolution, multi-dimensional attention, shallow and deep feature fusion, dual-path adaptive pooling, and residual classification heads. This approach can balance local details, long-range temporal dependencies, and cross-channel correlation information, improving feature representation capabilities while controlling the number of model parameters and computational load, making it suitable for deployment on computationally limited devices such as ventilators. Furthermore, this solution introduces an isomorphic direct transfer learning strategy, transferring general features learned from large-scale respiratory flow and pressure data to the target model. Fine-tuning is then performed using target scenario samples. This effectively alleviates the training difficulties caused by insufficient labeled samples, significant cross-individual differences, and cross-device distribution offsets in mask type recognition, improving the model's convergence speed, recognition accuracy, and generalization ability. Finally, the model outputs mask type classification probabilities, enabling automatic identification of ventilator masks. This provides a basis for subsequent wearing confirmation, parameter matching, and intelligent auxiliary adjustment, thereby improving the convenience, safety, and intelligence of home ventilator use.

[0145] Figure 2 This application provides an embodiment of a ventilator mask recognition system 10 based on transfer learning, such as... Figure 2 As shown, the ventilator mask recognition system 10 based on transfer learning includes at least the following parts: information acquisition module 11, data processing module 12, model adjustment module 13, and target model 14.

[0146] In this embodiment, the information acquisition module 11 is used to acquire time-series data of respiratory flow and respiratory pressure of the ventilator under normal ventilation conditions, and construct two-dimensional time-series feature data based on respiratory flow and respiratory pressure. Please refer to [link / reference] for details. Figure 1 The details and their corresponding descriptions are not repeated here.

[0147] In this embodiment, the data processing module 12 uses a fixed-window overlapping sliding method to divide the two-dimensional time-series data into discrete sample segments. These discrete sample segments are then input into a two-dimensional convolutional recognition model for feature extraction. An isomorphic transductive transfer learning strategy is employed to pre-train the two-dimensional convolutional recognition model, and the pre-trained model parameters are then transferred to the target model 14. Please refer to [link to details] for further information. Figure 1 The details and their corresponding descriptions are not repeated here.

[0148] In this embodiment, the model adjustment module 13 applies discrete sample fragments to fine-tune the target model 14, reducing the difference in marginal distribution between the source and target domain data. Please refer to [link / reference] for details. Figure 1 The details and their corresponding descriptions are not repeated here.

[0149] In this embodiment, the target model 14 is used to output classification probabilities to determine the identification result of the ventilator mask type. Please refer to [link / reference] for details. Figure 1 The details and their corresponding descriptions are not repeated here.

[0150] Figure 3 This is an electronic device 20 provided in one embodiment of this application. For example... Figure 3 As shown, the electronic device 20 includes at least the following components: a processor 21 and a memory 22.

[0151] In this embodiment, the memory 22 is used to store executable instructions of the processor 21, which, when configured to execute instructions, implement... Figure 1 The diagram shows a ventilator mask recognition method based on transfer learning.

[0152] It is understood that the ventilator mask recognition method, system, and device based on transfer learning provided in this application effectively solves the problem of insufficient samples for specific individuals or new devices by employing an isomorphic transductive transfer learning strategy and utilizing a large-scale pre-trained model to deeply mine the common patterns of respiratory signals. This approach reduces the distribution difference between the source and target domains, enabling the model to maintain high accuracy in mask type recognition even when faced with different patient wearing habits or hardware differences. The five-level cascaded convolutional neural network constructed by the scheme utilizes grouped dilated convolution to significantly reduce the number of parameters and computational complexity while effectively expanding the receptive field to capture long-term respiratory signal features. This design not only ensures recognition performance but also perfectly adapts to the hardware environment of home ventilator embedded systems with limited computing power and stringent power consumption requirements. Furthermore, feature extraction is more comprehensive and refined. Through a multi-dimensional attention enhancement module and deep and shallow feature fusion design, the system can weight and enhance key respiratory features from multiple dimensions such as channel weights, temporal dependencies, and spatial interactions, while taking into account both the detailed information and abstract semantics of the signal. Combined with dual-path adaptive pooling and residual connection techniques, the comprehensiveness of feature aggregation is further enhanced, and the gradient vanishing problem of deep networks is effectively alleviated, ensuring the real-time performance and stability of the recognition process.

[0153] Those skilled in the art should recognize that the above embodiments are only used to illustrate this application and are not intended to limit this application. Any appropriate changes and variations made to the above embodiments within the essential spirit and scope of this application fall within the scope of protection claimed in this application.

Claims

1. A ventilator mask recognition method based on transfer learning, characterized in that, The method includes: Collect time-series data of respiratory flow and respiratory pressure under normal ventilation conditions of the ventilator, and construct two-dimensional time-series feature data based on the respiratory flow and respiratory pressure; The two-dimensional time series data is divided into discrete sample segments by using a fixed window overlapping sliding method; The discrete sample fragments are input into a two-dimensional convolutional recognition model for feature extraction. An isomorphic transductive transfer learning strategy is adopted to pre-train the two-dimensional convolutional recognition model, and the parameters of the pre-trained model are transferred to the target model. The discrete sample fragments are used to fine-tune the target model, reducing the difference in marginal distribution between the source and target domain data. The identification result of the ventilator mask type is determined by the classification probability output by the target model.

2. The method of claim 1, wherein, The two-dimensional convolutional recognition model applies a five-level cascaded architecture. The two-dimensional convolutional recognition model includes: a convolutional feature extraction module for initially extracting flow and pressure features; a multi-dimensional attention enhancement module for enhancing key features; a shallow and deep feature fusion module for aligning details and semantic information; a dual-path adaptive pooling feature aggregation module for feature compression and aggregation; and a residual classification head module for outputting classification results.

3. The method of claim 2, wherein, The convolutional feature extraction module includes multiple basic convolutional units. Each basic convolutional unit includes an adaptive equal-width padding layer, a grouped dilated convolutional layer, a batch normalization layer, a non-linear activation layer, a temporal dimension downsampling layer, and a random deactivation layer. The grouped dilated convolutional layer achieves lightweighting by adaptively adjusting the number of groups and expands the convolutional receptive field by using the dilation rate to capture long-range temporal features.

4. The method of claim 3, wherein, The multi-dimensional attention enhancement module includes three parallel attention branches: a channel attention branch, a temporal attention branch, and a cross-channel attention branch. The channel attention branch focuses on important channel features through global average pooling, the temporal attention branch extracts temporal dependencies in the width dimension, and the cross-channel attention branch models spatial interaction relationships in the height dimension. Feature enhancement is achieved by multiplying the weight matrices generated by the three branches element-wise with the original feature map.

5. The ventilator mask recognition method based on transfer learning according to claim 4, characterized in that, The feature fusion module is used to fuse shallow and deep features of the model: The shallow features output by the second basic unit in the convolutional feature extraction module are pooled to the same spatial dimension as the deep features output by the multi-dimensional attention module by an adaptive average pooling layer. After concatenating the channels, a 1x1 convolutional layer is used for dimensionality reduction and fusion to extract detailed information and abstract semantics of the features.

6. The ventilator mask recognition method based on transfer learning according to claim 2, characterized in that, The residual classification head module is located at the end of the two-dimensional convolutional recognition model; The residual classification head module employs a three-level fully connected layer serial architecture and introduces residual connections between layers to gradually reduce the feature dimension and map to the final classification space.

7. The ventilator mask recognition method based on transfer learning according to claim 6, characterized in that, The residual classification head module includes: The first fully connected layer is used to map the input features to the first intermediate dimension and perform random deactivation processing; The second fully connected layer is used to map the features to the second intermediate dimension and add and fuse them with the feature output from the residual branch; The third fully connected layer maps the fused features to the same dimension as the number of preset mask types, and outputs the classification prediction results.

8. The ventilator mask recognition method based on transfer learning according to claim 1, characterized in that, The two-dimensional convolutional recognition model also includes a dual-path adaptive pooling feature aggregation module; The dual-path adaptive pooling feature aggregation module adopts a parallel pooling architecture, which uses a global adaptive average pooling layer to aggregate global spatial and temporal features, while using a temporal adaptive average pooling layer to retain local features in the temporal dimension. The two pooling results are concatenated and then the feature dimension is unified through an adaptive one-dimensional pooling layer to fix the input dimension of the classification head.

9. A ventilator mask recognition system based on transfer learning, applied to implement the ventilator mask recognition method based on transfer learning as described in any one of claims 1 to 8, characterized in that, The system includes: The information acquisition module is used to acquire time-series data of respiratory flow and respiratory pressure of the ventilator under normal ventilation conditions, and to construct two-dimensional time-series feature data based on the respiratory flow and respiratory pressure. The data processing module uses a fixed window overlapping sliding method to divide the two-dimensional time series data into discrete sample segments; inputs the discrete sample segments into a two-dimensional convolutional recognition model for feature extraction; and uses an isomorphic transductive transfer learning strategy to pre-train the two-dimensional convolutional recognition model and transfer the pre-trained model parameters to the target model. The model adjustment module applies the discrete sample fragments to fine-tune the target model, reducing the difference in marginal distribution between the source domain and the target domain data. The target model is used to output classification probabilities to determine the identification result of the ventilator mask type.

10. An electronic device, characterized in that, include: processor; as well as A memory having computer-readable instructions stored thereon for controlling the processor to execute the ventilator mask recognition method based on transfer learning as described in any one of claims 1 to 8.