Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2026 May 11;16:21380. doi: 10.1038/s41598-026-49343-z

AI-enabled wireless wearable breathing sensor for breathing pattern recognition

Carter Comeau 1, Bhawya 1, Partha Sarati Das 1, Brooke R Shepley 2, Nicholas J Lester 2, Syed Anees 3, Anthony R Bain 2, Simon Rondeau-Gagné 4, Mohammed Jalal Ahamed 1,✉
PMCID: PMC13346621  PMID: 42115202

Abstract

This paper presents an AI-driven multisensor wearable system for real-time breathing pattern recognition by integrating an inertial measurement unit (IMU) and a flex sensor with wireless data connectivity. Three artificial intelligence models—transformer, convolutional neural network–long short-term memory (CNN-LSTM), and histogram gradient boosting (HGB)—were evaluated for breathing pattern recognition across different model complexities (complex, simple, pure) and sensor configurations (IMU , Flex , and combined). The multisensor system combined with AI model was tested with multiple participants. The complex transformer model, trained with focal loss on the combined IMU and flex sensor data, achieved the highest performance, with 93.41% accuracy and a mean area under the curve (AUC) of 0.9919, outperforming all the other models. Multimodal input significantly improved classification accuracy—up to 20% higher than flex sensor models in six-class tasks—while focal loss enhanced robustness, particularly in addressing class imbalance. These results demonstrate the potential of combining wearable sensor fusion with deep learning to enable accurate, noninvasive, and wireless real-time respiratory monitoring, with potential applications in clinical diagnostics, telemedicine, and personalized health tracking.

Supplementary Information

The online version contains supplementary material available at 10.1038/s41598-026-49343-z.

Keywords: Wearable Sensor, Artificial Intelligence, Breathing Pattern Detection, Time Series Classification

Subject terms: Computational biology and bioinformatics, Engineering, Health care, Mathematics and computing

Introduction

Abnormalities in breathing are among the important vital signs of worsening health conditions—yet subtle changes in breathing patterns often go unnoticed until they progress into serious conditions. From sleep apnea and chronic obstructive pulmonary disease (COPD) to heart disease, early detection and continuous monitoring of respiratory function can have life-saving impacts. Traditionally, mouthpiece spirometry has served as the gold standard for assessing lung performance, but its dependence on clinical settings, scheduled visits, and direct device contact limits its accessibility and long-term monitoring. These constraints make spirometry impractical for continuous, at-home monitoring, delaying early diagnosis and preventing timely interventions. Spirometer requires trained personnel and specialized lab settings which limits its practical use outside supervised lab settings 1. Small changes in physiological variability patterns are associated with illness and may be better detected through continuous monitoring which may improve clinical assessments2. There is a need for remote monitoring solutions that can provide accessible, real-time health monitoring technologies for early detection and evaluation of treatment progression3. Furthermore, available wearable sensing methods are not equipped with sufficient smart detection and identification methods and often struggle to account for small changes due to wearability as well as individual differences in breathing patterns because of factors such as body type, age, and health condition4. Therefore, there is a demand for smart, wearable and wirelessly connected breathing sensing systems that can provide clinical-grade accuracy and detect small deviations in breathing patterns.

Wearable sensor technology for respiratory monitoring has therefore undergone significant advancements in recent years. In5 and 6, comprehensive reviews of breath sensors for health monitoring highlighted the potential of various sensing technologies and emphasized the importance of sensor miniaturization and energy efficiency—both critical factors in developing wearable devices that align with broader trends in respiratory technology6. In7, a coaxial nanofiber mask capable of detecting subtle respiratory signals was introduced. When combined with machine learning algorithms, this mask enables real-time monitoring and analysis of respiratory data, demonstrating the promise of integrating novel materials with artificial intelligence (AI) for enhanced respiratory monitoring. Recent studies have explored diverse sensor technologies and machine learning algorithms to improve the accuracy and adaptability of respiratory monitoring systems. For example, in8, a machine-learning-enabled wireless wearable respiratory sensor was developed, highlighting the importance of AI in personalizing respiratory monitoring. Similarly, devices such as the Respiro system, which employs ultrawideband radar technology to monitor respiratory rates during motion, shows the potential of wearable technology for home-based respiratory monitoring9.

In the realm of AI applications for biosignal analysis10, researchers demonstrated the effectiveness of deep learning in predicting respiratory rates from multiple biosignals including electrocardiogram (ECG) and photoplethysmogram (PPG). In11, deep learning techniques were applied for classifying and detecting breathing patterns with chest-and abdomen-mounted wearable sensors, showing promising results in distinguishing between different types of breath. This work, together with the work in12, provided valuable insights into the strengths and weaknesses of various machine learning and AI approaches, guiding our model selection and evaluation. To address the challenge of limited labeled physiological data13, researchers introduced TS-MoCo, a self-supervised learning framework for physiological representation learning that leverages unlabeled data to improve model adaptability, an approach particularly valuable for noisy datasets. Similarly in14, researchers demonstrated how data augmentation techniques can improve machine learning robustness, which is essential for wearable sensor applications. The application of such techniques to physiological data is evident in15, which used deep learning for ECG signal classification. While their focus was cardiac signals, many of the challenges they addressed—such as noisy biological signals and interpatient variability—are directly relevant to respiratory pattern recognition. The versatility of advanced AI models has been further demonstrated in health monitoring; for example16, employed a transformer encoder with multiscale deep learning for pain classification via physiological signals, highlighting the potential of transformer models in healthcare. Apart from integrating machine learning and AI, the breathing sensor hardware also seen significant progress.

Although notable progress has been made in wearable respiratory monitoring sensing systems using different types of sensors, , such as strain, inertial, acceleration, resistive, or piezoelectric sensing4–11, both single sensor and multisensor systems are employed but recent approaches increasingly leveraging multisensor systems for robustness and accuracy. Single-sensor systems are often vulnerable to artifacts caused by posture, body movement, and sensor placement, which can reduce signal quality and make subtle breathing-pattern differences difficult to detect. To address these limitations, we developed a dual-sensor approach that combines an inertial sensor and a resistive flex sensor to capture complementary aspects of respiratory motion, where each sensor compensates for the other’s susceptibility to specific motion artifacts. As illustrated in Fig. 1, this multisensor design allows chest wall deformation and motion-related information to be analyzed together, improving the richness of the measured respiratory signal. Because prior AI-based breathing classification studies have largely focused on data from a single sensor type, the present study evaluates whether multisensor fusion can improve robustness and classification performance in wearable breathing-pattern recognition.

Fig. 1.

Fig. 1

Overview of the proposed system including the wearable multisensor , mobile application for monitoring, data processing pipeline with peak detection, and the training and evaluation of AI models (Transformer, CNN-LSTM, and Histogram Gradient Boosting) for classifying different breathing types.

In this study, we evaluate a wireless wearable breathing sensor that combines IMU and flex sensing with machine learning for breathing-pattern classification under controlled laboratory conditions. Concurrent spirometry was collected as a physiological reference during experimentation. We compared transformer, CNN-LSTM, and histogram gradient boosting models across multiple sensor configurations to determine which modeling and sensor combination strategy most effectively distinguishes breathing patterns from wearable signals. The specific objective of this work was to determine whether multisensor fusion improves breathing-pattern classification relative to single-sensor input and whether modern deep sequence models provide an advantage over a traditional feature-based baseline. This study is intended as a foundational validation in healthy adults and as a step toward future respiratory monitoring systems that can later be evaluated in clinical and free-living settings.

Materials and methods

A controlled experimental comparison was performed between the wearable breathing sensor and spirometry during simultaneous data collection. The wearable system recorded IMU and flex sensor signals, while a spirometer provided concurrent physiological reference measurements, including respiratory rate, flow, and volume information. These data were collected to support physiological validation of the wearable signals during supervised breathing maneuvers. Because breathing behavior can vary with posture, body position information was also included in the experimental dataset to improve the robustness of the classification models. Figure S1 and Figure S2 show the hardware and representative wearable-versus-spirometry signal comparisons, respectively.

The wearable breathing sensor hardware consists of one ESP32-C3 microcontroller with a 160 MHz RISC-V architecture microprocessor, a 6-axis inertial measurement unit (IMU), and an analog flex resistive sensor. Details about the core components and pin configurations are given in supplementary sensor development Sect.  1.1. Bluetooth low energy (BLE) is chosen as the standard communication protocol for the breathing sensor because of its low power consumption, less hardware and compatibility17,18. A service with eight distinct characteristics was established to collect real-time data. A detailed service structure is given in Figure S3. The corresponding data types for each characteristic are given in Table T1.

A full-stack web application was developed to facilitate data collection and storage with quality control monitoring during acquisition. The application supports a BLE connection, with data acquired at a base sampling interval of 15 ms. Each second, the acquired 12-bit sensor values undergo signal processing, which includes conversion to physical units via appropriate scaling factors, application of validation filters, and body position calculations via the sensor fusion technique. The validation filters consisted of finite-value checks, buffer-based trend validation for the flex sensor (20-sample rolling window with ± 40-unit thresholds to confirm inhalation/exhalation), and debouncing of body-position updates (new states are emitted only when stable changes are detected). Fusion of the IMU and flex sensor data mitigates the impact of motion artifacts, a common challenge in wearable sensing. Finally, body position is determined through the combined analysis of accelerometer and gyroscope readings, as shown in Fig. 2.

Fig. 2.

Fig. 2

Flowchart illustrates the decision-making algorithm used by the wearable sensor to classify body position. The algorithm evaluates accelerometer and gyroscope data to distinguish between sitting, lying, rolled left, rolled right, and swing/neutral positions based on predefined thresholds and computed roll angles.

The raw data are organized with the combination of participant, body position and breath type to create the metadata structure, which becomes input to further processing of the data. The extracted metadata—participant number, position, and breathing type—were appended directly as new columns within each data sheet. Figure S4 shows the distribution of raw samples across positions, breathing types, and participants before any cleaning or filtering was applied. The preprocessing pipeline was designed with transparency, reproducibility, and rigor in mind. All the rules for data removal and modification were clearly documented, reflecting best practices for maintaining dataset quality and consistency. After preprocessing and cleaning, the refined dataset was saved to a new Excel workbook, providing a robust foundation for reliable downstream analyses and modeling tasks. The details of preprocessing are provided in supplementary data processing and feature engineering Sect. 3.

Signal processing and feature extraction from the organized and clean data were performed to prepare the dataset for training and analysis using machine learning models. The flex sensor data were processed via techniques such as scaling, rolling mean and standard deviation calculations, and peak detection to identify breathing patterns and cycles. These preprocessing steps helped refine the raw sensor readings, making them more suitable for further analysis. To capture the temporal dynamics of the breathing patterns, the data were then segmented into adaptive windows19. Figure S5 shows the relationship between window size and the average number of breathing cycles captured across different breathing types. Figure S6 shows an example of a breathing signal window with detected peaks, a key step in extracting cycle-based features. While not as exhaustive as highly comparative feature sets used in some time series analyses, such as those in20, the selected features aimed to capture the most relevant respiratory dynamics.

Combining the IMU and flex sensor data via the process explained in the supplementary ‘ advanced engineering features’(Sect.  3.3) extended feature engineering framework enabled a detailed investigation into how motion-based data can enhance respiratory pattern recognition. The integration of IMU and flex sensor data provided a richer signal representation and allowed for the evaluation of multimodal sensor fusion in improving model performance.

For effective model training, it is important to have consistent data quality. To achieve reliable and unbiased model evaluation, data quality and preprocessing pipelines were introduced, which emphasize maintaining data integrity, preventing information leakage and enhancing the robustness of datasets. The statistical methods are explained in the supplementary file in terms of the data quality and preprocessing pipeline.

Experimental protocol

Participants

Twenty (7 females) young adults (19–35 years of age) participated in this study. The participants were free from overt cardiovascular and respiratory diseases, as confirmed by a pretest health questionnaire. The participants had an average height of 174.95 ± 11.68 cm, weight of 80.90 ± 26.71 kg, chest circumference of 95.08 ± 8.82 cm, and waist circumference of 83.38 ± 9.62 cm (all values mean ± standard deviation). The Research Ethics Board (REB) at the University of Windsor (REB no. 22–166) cleared all experimental procedures and protocols in adherence with the principles of the Declaration of Helsinki and the Tri-Council Policy Statement, except for registration in a clinical database. Written informed consent was obtained from all participants prior to their participation in the study.

Experimental setup

The participants who arrived at the lab abstained from caffeine and alcohol for a minimum of 12 h. Upon arriving at the lab, participant demographics were first obtained. Thereafter, the participants were instructed to lie on a medical bed for instrumentation. The wearable sensor was secured using hypoallergenic adhesive paper tape. Each participant was provided with a mouthpiece connected to a filter, a calibrated flow head, and a high-precision spirometer for ventilation monitoring, along with a nose clip to ensure that breathing occurred solely through the mouth. For each test, the participant was instructed to perform a specific breathing maneuver, and the recording was started, stopped, and saved under that predefined breathing pattern label.

Spirometry

The respiratory data was obtained via a spirometer (ADInstruments, Colorado Springs, CO, USA). Prior to each experiment, the spirometer was calibrated with a 3-L turbine. The respiratory rates and volumes were determined in real time via PowerLab and LabChart Pro (ADInstruments). In this study, spirometry was used as a physiological reference to verify respiratory behavior during the supervised trials and to support interpretation of the wearable sensor signals.

Although spirometry was collected concurrently during all trials, breathing pattern labels were assigned based on the experimenter’s instruction to perform a specific maneuver rather than derived automatically from spirometric measurements. This instruction-based labeling approach assumes participant compliance with the directed breathing task. While the concurrent spirometry data allowed visual verification that the performed maneuver was consistent with the instructed pattern, no automated classification threshold was applied to the spirometric signal to generate or confirm labels. This represents a limitation of the present labeling strategy: the ground truth relies on the assumption of faithful execution rather than on an independent physiological criterion. Future work could incorporate spirometry-derived metrics, such as tidal volume and respiratory rate thresholds, as quantitative criteria for label verification or as a secondary gold standard.

Model architectures

Our study evaluated three distinct model architectures for breathing pattern classification: a transformer-based model, a CNN-LSTM hybrid, and a gradient boosting model. Recent advancements in deep learning for respiratory monitoring have demonstrated the effectiveness of CNNs and LSTMs for breath classification, particularly in wearable applications20. For the deep learning approaches, we developed pure, complex, and simplified variants to investigate the impact of architectural choices on classification performance.

1) Transformer Architecture: Transformer-based models process both time series and auxiliary features through a dual-input architecture. Figure S7, inspired by the visualization presented in21, illustrates the multihead self-attention mechanism, which incorporates spatial depthwise convolutions for the query (Q), key (K), and value (V) projections. The primary time series branch utilizes the following key components:

(a) Pure Transformer Variant

  • Direct processing of input features through dense projection layers.

  • 4 transformer blocks with 16-head attention mechanisms.

  • Consistent hidden dimensions of 128 units.

  • Dropout rates of 0.4 for regularization.

(b) Complex Variant

  • Multiscale CNN feature extraction (kernel sizes 3, 7, and 11).

  • 4 Transformer blocks with enhanced capacity (128 channels).

  • Increased regularization through spatial dropout and L2(prevents overfitting).

  • Expanded intermediate representations (256 units).

(c) Simplified Variant

  • Reduced CNN feature extraction (48 channels).

  • 2 transformer blocks with 6 attention heads.

  • Balanced dropout rates (0.2–0.3).

  • Optimized parameter counts through smaller dimensions.

2) CNN-LSTM Architecture: The CNN-LSTM models combine convolutional feature extraction with sequential processing. Figure S8, following the structural depiction described in22, provides an overview of an LSTM cell, showing how it processes information in three steps: forgetting irrelevant information, adding new information, and passing the updated information to the next time step. Key architectural elements include the following:

  1. Pure LSTM Variant

  • Stacked bidirectional LSTM layers (64–128–64 units).

  • Layer normalization between LSTM blocks.

  • Direct sequence processing without convolution.

  • b)

    Complex Variants

  • Dual-stream CNN feature extraction

  • Triple stacked bidirectional LSTM (32 units each)

  • Residual connections around LSTM blocks

  • Feature fusion through skip connections

  • c)

    Simplified Variant

  • Matched complexity with transformers (24 channels).

  • Single LSTM layer with 48 units.

  • Efficient 1 × 1 convolutions for dimension matching.

  • Reduced parameter counts through shared projections.

3) Feature Fusion and Output: All the deep learning models incorporate the following:

  • Auxiliary feature processing through dense layers.

  • Batch normalization and dropout for regularization.

  • Concatenative feature fusion.

  • Final classification through Softmax activation.

4) Gradient Boosting Model: The HistGradientBoostingClassifier serves as a nondeep learning baseline, processing flattened time series and auxiliary features. The hyperparameters were optimized through a random search, with key settings, including the learning rate, maximum depth, and number of iterations. The architecture includes the following:

  1. Core Configuration

  • 960 maximum iterations with early stopping patience of 20 iterations.

  • Learning rate of 0.013 for gradual model improvement.

  • Maximum tree depth of 6 to prevent overfitting.

  • 254 histogram bins for efficient feature discretization.

  • b)

    Regularization Strategy

  • L2 regularization strength of 1.5 to control model complexity.

  • Feature subsampling at 70% per tree to increase robustness.

  • A minimum of 25 samples per leaf were used to ensure reliable splits.

  • Maximum of 60 leaf nodes per tree to balance flexibility and generalization.

  • c)

    Training Controls

  • 20% validation fraction for early stopping.

  • Tolerance of 1e-5 for convergence checking.

  • Balanced class weights to handle class imbalance.

  • Early stopping based on the validation score plateau.

The HGB processes a flattened representation of the time series data concatenated with auxiliary features, providing an efficient alternative to deep learning approaches while maintaining competitive performance through careful hyperparameter optimization.

All the models utilize focal loss with class weights to address class imbalance, except for the gradient boosting model, which employs its native handling of imbalanced data. Figure S9, which adapts the ensemble visualization introduced in23, illustrates the architecture of this ensemble learning model, where individual tree predictions are combined through weighted contributions to determine the final classification. The deep learning models additionally implement mixed precision training (float16) for improved computational efficiency.

Model development

Model development focused on comparing three model families, transformer, CNN-LSTM, and histogram gradient boosting, under consistent preprocessing and evaluation conditions. For the deep learning approaches, pure, simplified, and complex variants were explored to determine how architectural capacity influenced classification performance across sensor configurations and class definitions. High-performance GPU hardware, including an NVIDIA H100, was used to accelerate model training and hyperparameter exploration; however, this hardware was used only during model development and does not imply that future sensing or inference requires H100-class devices. To further confirm deployment flexibility, the trained models were also exported to ONNX format and successfully executed using ONNX Runtime outside the H100 training environment, including web-based inference. Figure 3 compares focal loss and standard cross-entropy for the transformer model on the 6-class combined IMU andFlex dataset, and Table 1 summarizes the main validation results across representative model configurations.

Fig. 3.

Fig. 3

Validation loss curves comparing focal loss and standard cross-entropy for the Transformer model trained on the 6-class combined IMU andFlex dataset. Focal loss exhibits smoother convergence and lower final validation loss, particularly improving model confidence on imbalanced classes.

Table 1.

Performance comparison of model configurations on validation data. abbreviations: auc = area under curve, avg f1 = average f1 score. best results for each metric are in bold.

Architecture Model Data Classes Loss Accuracy Mean AUC Avg. F1
Complex Transformer IMU+Flex 3 Focal 93.41 0.9919 0.9353
Complex CNN-LSTM IMU+Flex 3 Focal 90.31 0.9804 0.9127
Complex Transformer IMU+Flex 6 Focal 80.69 0.9665 0.8426
Simpler Transformer IMU+Flex 3 Focal 90.70 0.9784 0.9192
Pure Transformer IMU+Flex 3 Standard 77.52 0.9511 0.8395
Complex Transformer Flex 3 Focal 70.93 0.8733 0.7456
  • I.

    Initial Development Phase: Our development began with simple baseline implementations to establish fundamental performance metrics. Initial experiments using single-stream networks processing flex sensor data showed a limited capacity to capture complex breathing patterns. These early implementations faced several challenges: LSTM models suffered from vanishing gradients over long sequences, basic transformer models struggled with local feature extraction, and preliminary gradient boosting experiments highlighted the importance of engineered features.

The processing of breathing data presented unique challenges that required careful consideration. Variable-length breathing sequences require a sophisticated approach to data windowing. Our initial fixed-window approach often led to truncation of important patterns, suggesting the development of an adaptive windowing system on the basis of breathing cycle detection. This adaptive approach significantly improved the model’s ability to capture complete breathing patterns while maintaining computational efficiency.

  1. Training Infrastructure Development: The complexity of our models requires sophisticated training infrastructure beyond basic frameworks. We developed a custom MemoryEfficientDataLoader class to handle the substantial memory requirements of our training process. This loader implemented dynamic batch size adjustment on the basis of available memory and included automatic garbage collection triggers to prevent memory overflow. The system also optimized the input pipeline with prefetching and caching mechanisms, significantly reducing data loading bottlenecks.

Early training experiments revealed unstable training dynamics that required a comprehensive callback system. We implemented a calculated learning rate scheduling system with warm-up periods and cosine decay, complemented by continuous monitoring of gradient norms and training state verification. This system proved crucial for maintaining stable training across our diverse model architecture.

To ensure reliable model comparison, we developed a unified evaluation framework that supported both neural and traditional models. This framework integrates performance metric computation with visualization capabilities and maintains consistent cross-validation procedures across all the experiments. The implementation of stratified fold generation proved particularly important for maintaining class balance across validation sets.

  • 2)

    Model-Specific Challenges and Solutions: The transformer architecture presented unique challenges during development. Initial attention mechanisms showed quadratic memory scaling that proved problematic with longer sequences. Traditional local attention patterns fail to capture global breathing rhythms effectively. We address these issues through the implementation of progressive attention span increases during training and the development of multihead attention mechanisms with varying receptive fields. These modifications, combined with gradient checkpointing for memory efficiency, achieved a 40% reduction in memory usage while maintaining model performance.

The addition of CNN layers as initial feature extractors proved crucial for both transformers and LSTM architectures. For transformers, raw time series input creates computational bottlenecks in the attention mechanism and fails to capture local patterns efficiently. By implementing CNN frontend layers, we reduce the effective sequence length while extracting hierarchical features, addressing both issues simultaneously. The CNNs’ inherent locality bias complemented the transformer’s global attention, allowing the model to better capture both fine-grained respiratory patterns and longer-term dependencies.

In the CNN-LSTM architecture, direct processing of raw sequences by LSTM layers results in slower convergence and difficulty in capturing rapid breathing pattern variations. The CNN frontend provided automatic feature extraction of local respiratory characteristics across multiple temporal scales. This hierarchical feature extraction significantly reduced the sequence length the LSTM needed to process while providing rich, localized feature representations. The combination allowed the LSTM to focus on modeling temporal dependencies between these extracted features rather than raw signal variations, improving both training efficiency and model performance.

Our CNN-LSTM implementation initially showed feature extraction bottlenecks and struggled with gradient flow between the CNN and LSTM components. We address these issues by implementing residual connections for improved gradient flow and developing a feature pyramid approach for multiscale analysis. The addition of bidirectional processing with merged features significantly improved the model’s ability to capture temporal patterns, resulting in a 35% improvement in convergence speed.

The gradient boosting model requires careful optimization to prevent overfitting on our complex feature set. Memory constraints with high-dimensional data initially limit the model’s effectiveness. Through careful tuning of the tree depth and L2 regularization parameters, combined with feature importance-based selection, we achieve a more robust and efficient implementation.

  • 3)

    Training strategy refinement: Our approach to training underwent significant refinement throughout the development process. The initial fixed learning rate schedules showed inconsistent convergence patterns, leading to the development of a multiphase learning rate strategy. We implemented a warm-up period followed by cosine decay with restarts, which proved more effective at navigating the loss landscape. The addition of adaptive scheduling based on validation metrics further improved training stability. The development of our loss function strategy began with standard cross-entropy but evolved as we encountered challenges with class imbalance, particularly in the 6-class scenario. We developed and tested an enhanced focal loss implementation incorporating class weighting and label smoothing alongside standard cross-entropy. While initial experiments yielded varied results during training, the final model configurations reported in this study utilized focal loss for the deep learning architectures (transformer, CNN-LSTM). This choice was based on achieving the best overall performance.

The validation performance (accuracy and AUC), particularly for the complex models and the 6-class task, indicates better generalizability and robustness against class imbalance, as detailed in the results section. The histogram gradient boosting model utilizes its native capabilities for handling imbalanced data.

Our final model configurations emerged from this extensive development process, representing optimal combinations of architectural choices, training strategies, and hyperparameter settings. Each decision was validated through extensive experimentation and comprehensive performance monitoring, ensuring reliable and reproducible results.

Results

Model performance

We evaluated three model architectures (transformer, CNN-LSTM, and histogram gradient boosting) across multiple configurations to assess their effectiveness in breathing pattern classification. Each architecture was implemented in three variants (complex, simple, and pure) and tested with both IMU and flex sensor data for 3-class and 6-class classification tasks. Table 1 summarizes the key performance metrics across all major configurations.

The complex transformer model with IMU and flex data combined shows performance across all the metrics in the 3-class classification task, reaching 93.41% validation accuracy and a mean AUC of 0.9919 when trained with focal loss. This configuration demonstrated exceptional balance across all breathing patterns, with class-specific F1 scores of 0.9146 (deep), 0.9282 (normal), and 0.9630 (shallow).

Model architecture complexity clearly affects performance. Using the 3-class IMU configuration as a benchmark, we observe a consistent performance gradient: complex transformer (93.41%) > simple transformer (90.70%) > pure transformer (77.52%). This pattern held across different model families, suggesting that architectural sophistication plays a crucial role in capturing the subtle differences between breathing patterns. Figure 4 compares the average validation accuracy across datasets, clearly illustrating the advantage of combining IMU and flex sensor data.

Fig. 4.

Fig. 4

Average validation accuracy across sensor input configurations. Combined IMU and Flex data provided the highest performance, followed closely by IMU. Flex data resulted in significantly lower accuracy, highlighting the importance of multi-modal sensor fusion for robust breathing pattern classification.

The choice of input features significantly influences model performance. The performance of the complex transformer with combined IMU andFlex data (93.41% accuracy, 0.9919 AUC) substantially exceeded its performance with flex data (70.93% accuracy, 0.8733 AUC), highlighting the importance of multimodal sensor input for accurate breathing pattern classification.

The increase from 3 to 6 classes revealed interesting physiological relationships in breathing pattern classification. While the overall performance decreased from 93.41% to 80.69% accuracy for the complex transformer, the confusion patterns provide valuable insights into both model behavior and breathing physiology.

Two key confusion patterns are particularly notable:

Deep Breathing vs. Yawning Confusion:

The models frequently demonstrated confusion between deep breathing and yawning patterns. Specifically, yawning is often misclassified as deep breathing. This confusion arises primarily from the mechanical similarities between these two breathing patterns. Both deep breathing and yawning involve substantial expansion of the thoracic cavity, resulting in similar sensor signatures. The key distinction between these breathing actions lies not in their mechanical motion but rather in the intention behind the action: yawning is an involuntary reflex, whereas deep breathing is consciously performed. However, because the sensor readings capture primarily physical movements, this subtle behavioral difference is difficult for models to detect.

Normal vs. Breath Hold Interactions:

Another prominent source of model confusion occurred between normal breathing and breath-hold patterns, with breath-hold events frequently misclassified as normal breathing. This was largely due to the structure of the experimental protocol itself, in which participants alternated between periods of normal breathing and breath holding. As a result, transitional states, particularly at the beginning and end of breath, exhibited ambiguous characteristics in the sensor data, closely resembling normal breathing patterns. Consequently, these transitional segments introduce ambiguous features, complicating the models’ ability to accurately distinguish between these two conditions. Figure 5 presents a side-by-side comparison of confusion matrices for the transformer, CNN-LSTM, and histogram gradient boosting (HGB) models using a six-class architecture.

Fig. 5.

Fig. 5

Side-by-side comparison of confusion matrices for the (a) Transformer, (b) CNN-LSTM, and (c) Histogram Gradient Boosting (HGB) models using a six-class architecture. All models were trained on the combined IMU + flex sensor dataset with a custom focal loss function. Each matrix highlights the classification performance for individual breathing patterns, including coughing, deep, hold, normal, shallow, and yawning.

These patterns were consistent across all model architectures, with the transformer (80.69% accuracy) and CNN-LSTM (73.10% accuracy) methods showing similar confusion distributions, suggesting that these challenges are inherent to the classification task rather than model-specific limitations. The HGB model showed more distributed confusion patterns, indicating a lower ability to capture the subtle distinctions between related breathing patterns.

This analysis suggests that the performance impact of 6-class classification stems not only from the increased number of classes but also from the inherent physiological overlap between certain breathing patterns. The models’ confusion patterns align with our understanding of respiratory mechanics, where certain breathing patterns share fundamental characteristics despite being fundamentally distinct.

The incorporation of focal loss was particularly beneficial for complex architectures and multiclass scenarios. In the 6-class IMU configuration, focal loss improved the performance of the complex transformer from 77.62% to 80.69% accuracy and increased the mean AUC from 0.9620 to 0.9665. This improvement was most pronounced in minority classes and complex breathing patterns, indicating better handling of class imbalance.

Notably, while the histogram gradient boosting model provided competitive baseline performance (mean AUC of 0.9089 for the 3-class IMU), it consistently fell short of the deep learning approaches across all configurations. This suggests that the temporal dynamics and subtle patterns in breathing data benefit significantly from deep architectural features.

Class-wise performance

Analysis of class-specific performance metrics reveals distinct patterns in how different models handle various breathing types. Table 2 presents the per-class F1-scores for the best performing configuration of each model architecture (Complex) in the 6-class IMU+Flex classification task, using focal loss for the deep learning models.

Table 2.

Class-wise f1-scores for best performing models (complex architecture) with imu+flex data (6-class task). fl. = focal loss.

Type Transformer(FL) CNN-LSTM(FL) HGB
Coughing 0.8824 0.9515 0.7527
Deep 0.8205 0.6736 0.5842
Hold 0.8345 0.7643 0.6519
Normal 0.8134 0.6878 0.5545
Shallow 0.9189 0.8545 0.7664
Yawning 0.7861 0.5771 0.5

Distinct patterns emerge in the classification performance across breathing types. Coughing consistently achieves high F1-scores (transformer: 0.8824; CNN-LSTM: 0.9515), likely because of its sharp, distinctive sensor patterns. Shallow breathing also performed well, particularly for the transformer (F1: 0.9189) and HGB (F1: 0.7664). These patterns are characterized by distinctive movements in the IMU data for coughing and consistent, reduced amplitude patterns for shallow breathing.

Figure 6 illustrates the precision‒recall characteristics of each class, which are averaged across all the models, and highlights the superior separability of classes such as coughing and shallow breathing. Normal breathing and breath holding presented a particular challenge, with F1 scores varying across models (e.g., transformer normal: 0.8134, hold: 0.8345; CNN-LSTM normal: 0.6878, hold: 0.7643), and significant cross-confusion was observed in the confusion matrices (Figure 5). Analysis of these matrices reveals instances where breath holding was misclassified as normal breathing, and vice versa. This confusion primarily occurs during transition periods between the two states, where the sensor patterns become temporarily ambiguous.

Fig. 6.

Fig. 6

Averaged precision-recall curves for each breathing class across all models in the 6-class IMU+Flex configuration. Coughing and shallow breathing exhibit the strongest separability, while yawning, normal, and breath-hold patterns show overlapping precision-recall behavior due to physiological and transitional similarities.

Compared with coughing or shallow breathing, yawning generally demonstrated lower classification performance (F1-scores: transformer 0.7861, CNN-LSTM 0.5771, HGB 0.5000), with substantial confusion with deep breathing patterns evident in Fig. 7. This confusion is physiologically reasonable given that both patterns involve extended inhalation phases and increased thoracic movement. The complex transformer showed the best discrimination between these similar patterns, achieving a substantially higher F1 score (approximately 36% higher) for yawning compared to the complex CNN-LSTM model.

Fig. 7.

Fig. 7

(a) Training and (b) validation accuracy/loss curves for the Complex Transformer and CNN-LSTM models on the 3-class IMU dataset. Both models converge smoothly, with the Transformer achieving higher final accuracy but the CNN-LSTM maintaining consistently lower loss. This discrepancy indicates that while the CNN-LSTM may make more confident predictions, the Transformer demonstrates superior class separation and overall classification accuracy.

In the simpler 3-class scenario (normal, deep, shallow), all models showed markedly improved performance, with the complex transformer (trained with focal loss) achieving F1 scores above 0.91 for all classes (deep: 0.9146, normal: 0.9282, shallow: 0.9630, per CSV dataset). This improvement suggests that the primary challenge lies not in detecting basic breathing patterns but in distinguishing between physiologically similar variations.

The incorporation of focal loss was particularly beneficial for complex architectures and multiclass scenarios. As noted previously, in the 6-class IMU configuration, focal loss improved the overall validation accuracy and mean AUC of the complex transformer compared with standard cross-entropy, indicating better handling of class imbalance across patterns.

Model training characteristics

Analysis of training dynamics reveals distinct patterns across different model configurations and data types. For the 3-class IMU classification task, both the transformer architecture and the CNN-LSTM architecture demonstrated stable and efficient convergence patterns. The complex transformer achieved final training and validation accuracies of 97.04% and 93.41%, respectively, with smooth convergence curves indicating effective learning without significant overfitting. Similarly, the CNN-LSTM model showed stable convergence, reaching 92.88% training accuracy and 90.31% validation accuracy.

The transition to 6-class classification introduced more challenging training dynamics. While both models maintained relatively high training accuracies (transformer: 94.18%, CNN-LSTM: 82.34%), the corresponding validation accuracy (transformer: 80.69%, CNN-LSTM: 73.65%) indicate increased generalization challenges. Figure 8 shows the training and validation accuracy/loss curves for the complex transformer and CNN-LSTM models on the 6-class IMU dataset. While both models achieve relatively high training accuracy, the validation curves reveal generalization challenges, particularly for the CNN-LSTM. Notably, CNN-LSTM maintains lower loss throughout training despite lower validation accuracy, suggesting more confident predictions, even in misclassified cases. A larger performance gap in the transformer model indicates greater sensitivity to complex class distinctions. This wider gap between training and validation performance suggests that the additional complexity of distinguishing between physiologically similar breathing patterns (such as deep breathing vs. yawning) introduces inherent generalization challenges.

Fig. 8.

Fig. 8

(a) Training and (b) validation accuracy/loss curves for the Complex Transformer and CNN-LSTM models on the 6-class IMU dataset. While both models achieve relatively high training accuracy, the validation curves reveal generalization challenges, particularly for the CNN-LSTM. Notably, CNN-LSTM maintains lower loss throughout training despite lower validation accuracy, suggesting more confident predictions, even in misclassified cases. The larger performance gap in the Transformer model indicates higher sensitivity to complex class distinctions.

Training with flex data revealed limitations in feature richness. Even for 3-class classification, complex architecture neural models showed less stable convergence patterns and lower overall performance (transformer validation accuracy: 70.93%, CNN-LSTM: 76.74%); however, the simpler architecture for each model proved to be more effective on solely flex datasets (transformer validation accuracy: 77.91%, CNN-LSTM: 77.91%). The reduced performance and more erratic learning curves suggest that flex sensor data alone provides insufficient information for robust breathing pattern classification, particularly for subtle pattern distinctions. The simpler model architecture outperforming the complex architecture can be attributed to the lack of variability in the data without the IMU features, hindering the complex model’s ability to learn meaningful patterns.

Loss trajectories across configurations provide additional insights:

  • 3-class IMU: Final validation losses of 0.5820 (transformer) and 0.2657 (CNN-LSTM) indicate strong confidence in the predictions.

  • 6-class IMU: Higher validation losses (transformer: 0.9426, CNN-LSTM: 0.7024) reflect increased classification uncertainty.

  • Flex: Elevated validation losses (> 1.0) suggest fundamental limitations in the input feature space.

The impact of focal loss on training dynamics was most pronounced in the 6-class scenario, where it helped balance the learning process across classes without significantly impacting convergence rates. This is particularly evident in the improved performance on minority classes without compromising the model’s ability to learn majority class patterns.

Notably, while both deep learning architectures showed similar convergence patterns, the transformer consistently achieved lower validation loss values across configurations, suggesting more confident and stable predictions. This aligns with the architecture’s superior performance in terms of final accuracy and class wise metrics.

Feature importance

Analysis of feature importance across different model architectures reveals interesting patterns in how each model utilizes the input features for breathing pattern classification. While each architecture employs different mechanisms for feature utilization, several key patterns emerge in their relative importance rankings.

Signal entropy emerged as a consistently important feature across all three architectures, appearing in the top features for the transformer (rank 3), CNN-LSTM (rank 3), and HGB (rank 1) models. This consistency suggests that the complexity and irregularity of breathing patterns provide crucial discriminative information regardless of the modeling approach.

Each model exhibited distinct patterns in feature utilization aligned with their architectural strengths. The transformer model heavily relies on temporal gyroscope z-axis features, particularly at time points t176, t177, and t131, highlighting their significance in capturing breathing dynamics. Additionally, it identified the standard deviation of peak heights as the single most influential statistical feature. Overall, the Transformer demonstrated a balanced combination of temporal and statistical feature usage, leveraging both aspects effectively for prediction.

In contrast, the histogram gradient boosting (HGB) model prioritized aggregate statistical features over individual temporal measurements. The most important features for this model included signal-level statistics such as the peak height standard deviation, underscoring its preference for summary metrics that represent overall signal complexity rather than raw sensor readings.

Conversely, the convolutional neural network combined with long short-term memory (CNN-LSTM) model prioritized features directly related to breathing cycle characteristics, such as average peak-to-trough distances and mean expiration durations. Additionally, amplitude-based statistics, including amplitude variance and average cycle amplitude, were highly influential, demonstrating the CNN-LSTM model’s ability to capture nuanced patterns within cycle-level dynamics. The model employs a balanced combination of both temporal and statistical features, reflecting its inherent flexibility in handling complex signal data.

These patterns explain the relative performance of each model for different breathing types. For example, the transformer’s attention to specific temporal points likely contributes to its superior performance in distinguishing between similar patterns such as deep breathing and yawning, where timing differences are crucial.

Notably, while the gyroscope z-axis features were prominent in the transformer and HGB models, the CNN-LSTM architecture showed more balanced utilization across different sensor types. This suggests that architectural choices influence not only overall performance but also the way different sensor inputs are utilized for classification.

Cross-validation performance

To further assess model performance under repeated class-balanced resampling, we performed 3-fold cross-validation on the 3-class IMU+Flex dataset using the simpler variants of each architecture. Cross-validation was implemented using stratified splitting based on breathing class labels to preserve class balance across folds. Because the split was applied at the sample level rather than by participant or by recording/test, samples derived from the same participant could appear in both training and validation folds. Participant-level splitting, in which all samples from a given individual are assigned exclusively to either training or validation, was not employed in this study. With 20 participants contributing variable numbers of samples across six breathing types, participant-level folds would likely introduce class imbalance and fold-size variability, potentially limiting the stability of cross-validation estimates. However, the sample-level strategy used here means that the model may partially learn participant-specific signal characteristics, such as baseline thoracic shape or breathing amplitude, which could inflate reported accuracy relative to a strictly participant-independent evaluation. Accordingly, these results should be interpreted as class-stratified sample-level performance estimates rather than as a strict measure of participant-independent generalization. Future studies with larger cohorts should adopt leave-subject-out or grouped k-fold cross-validation to provide a more rigorous assessment of between-participant generalizability.

To quantify overlap checks between training and validation samples, Table 3 summarizes the duplicate-overlap and split-strategy checks used in the training pipeline.

Table 3.

Quantitative overlap checks and partitioning strategy used in model training and evaluation.

Check Definition Result
Exact duplicate overlap Number of validation samples that exactly matched a training sample 0
High-similarity overlap Number of the first 100 checked validation samples with cosine similarity > 0.99 to any training sample 0/100
Holdout split strategy Method used to create the holdout set 10% class-stratified sample-level split
Cross-validation split strategy Method used to create CV folds 3-fold stratified by breathing class

As shown in Table 3, no exact duplicate samples and no highly similar samples were detected in the overlap checks performed during training. However, because partitioning was performed at the sample level rather than by participant, these checks should be interpreted as duplicate-overlap controls rather than as proof of participant-independent evaluation.

K-fold cross-validation is a statistical resampling technique commonly used to evaluate machine learning models on limited data. The dataset is divided into equally sized folds (in our case, k = 3), and the model is trained and evaluated k times. In each iteration, one-fold is held out as the validation set, and the remaining k–1 folds are used for training. This ensures that every data point is used for both training and validation, providing a comprehensive estimate of model performance and reducing the risk of overfitting to a single train‒test split.

This methodology is particularly valuable in domains such as physiological signal processing, where data can be scarce or highly variable. By testing the model across multiple class-balanced data partitions, cross-validation provides insight into the stability of model performance under the evaluation framework used in this study.

The transformer model achieves the strongest and most consistent results across all the metrics. Averaged over three folds, it achieved an accuracy of 90.47% (± 0.68), precision of 90.57% (± 0.72), recall of 90.47% (± 0.68), F1 score of 90.47% (± 0.73), and a high ROC AUC of 0.9796 (± 0.0029). These results indicate that the transformer model maintained strong performance across the class-stratified sample-level cross-validation splits used in this study.

Figure 9 presents a bar chart of the average cross-fold performance across five standard classification metrics (accuracy, precision, recall, F1 score, and ROC AUC) for each model. The error bars represent the standard deviation across the three folds.

Fig. 9.

Fig. 9

Average cross-validation performance metrics with standard deviation for each model (Transformer, CNN-LSTM, HGB) using IMU+Flex sensor data in the 3-class classification task. The Transformer shows consistently high performance and low variance across all metrics, indicating strong generalization.

The CNN-LSTM model also demonstrated strong performance across the class-stratified sample-level folds, with an average accuracy of 87.52% (± 1.52) and an ROC AUC of 0.9656 (± 0.0099). While slightly trailing the transformer model, its low variance across folds suggests that it is a stable and effective architecture for this task.

The histogram gradient boosting (HGB) model achieved lower overall performance, with an average accuracy of 75.50% (± 1.34), F1 score of 75.48% (± 1.26), and ROC AUC of 0.9012 (± 0.0066). While it remained relatively consistent across folds, its lower precision and recall indicate difficulty in handling the temporal dynamics and subtle differences between breathing classes.

Overall, the results of this cross-validation study reinforce the advantages of deep learning for time series physiological classification. Even in their simpler forms, the transformer and CNN-LSTM models outperformed traditional approaches in both performance and consistency under the class-stratified sample-level evaluation framework used here.

Performance on unseen data

To evaluate performance on held-out samples, we tested our best-performing configurations (complex models with IMU data and focal loss) on a test set isolated from the training process. The holdout split was stratified by breathing class at the sample level rather than by participant, so samples from a given participant may appear in both training and holdout sets. As discussed in Section E, this approach was adopted to maintain class balance given the limited cohort size, but it means that reported holdout accuracy may be optimistic relative to a fully participant-independent test. This evaluation therefore reflects performance on unseen samples rather than strict participant-independent generalization The holdout set comprised 144 samples for 3-class classification and 308 samples for 6-class classification, maintaining similar class distributions to those of the training data.

As summarized in Table 4, all the models maintained strong performance on the held-out samples in the 3-class classification task. The complex transformer achieves the highest holdout accuracy of 93.06%, followed by the CNN-LSTM at 89.58% and the HGB at 83.33%. The class-wise performance was notably balanced, with F1 scores ranging from 0.91 to 0.95 for the transformer model, indicating consistent performance across all breathing patterns.

Table 4.

Three class validation and holdout accuracy.

Model Validation Acc. Holdout Acc.
Transformer 93.41% 93.06%
CNN-LSTM 90.31% 89.58%
HGB 77.52% 83.33%

For the more challenging 6-class task, the results are shown in Table 5. The performance differences between the architectures were more pronounced: the complex transformer achieved the strongest performance, with 78.57% accuracy, whereas the CNN-LSTM achieved 74.03%, and the HGB decreased to 58.12%. The performance hierarchy observed during validation was preserved on the holdout set, confirming the robustness of our architectural comparisons.

Table 5.

Six-class validation and holdout accuracy.

Model Validation Acc. Holdout Acc.
Transformer 80.69% 78.57%
CNN-LSTM 73.65% 74.03%
HGB 61.55% 58.12%

Class wise analysis of the 6-class task revealed that all the models maintained high performance on distinctive breathing patterns, such as coughing (transformer F1: 0.91, CNN-LSTM F1: 0.90) and shallow breathing (transformer F1: 0.88, CNN-LSTM F1: 0.88). However, more subtle distinctions, particularly between normal breathing and breath holding, remained challenging even for the best-performing models.

The HGB model showed the largest performance drop between the validation and holdout sets, particularly in the 6-class task, suggesting that deep learning architectures provide better generalizability for complex breathing pattern classification. This aligns with our earlier findings regarding the importance of temporal features learning for distinguishing similar breathing patterns.

These results demonstrate that complex deep learning models, particularly the transformer architecture, maintain their performance advantages on held-out samples, supporting further investigation of their use in breathing pattern classification applications.

Discussion

This study demonstrates that combining multisensor wearable data with modern deep learning architectures can support accurate breathing pattern classification under controlled experimental conditions in healthy adults. The strongest results were obtained with the transformer model, which achieved 93.06% accuracy on held-out samples for the 3-class task and 78.57% for the 6-class task. These findings compare favorably with representative prior breathing-pattern classification studies, as summarized in Table 5, while also reflecting the specific experimental design and classification tasks used in the present work. Overall, the results support the feasibility of the proposed approach as a foundational validation study and motivate further evaluation in broader and more clinically relevant settings.

To place the present findings in quantitative context, Table 5 compares the performance of the proposed system with representative prior breathing-pattern classification studies.

As shown in Table 6, the present results compare favorably with representative prior studies, although direct comparison remains limited by differences in sensing modality, number and definition of classes, and evaluation strategy.

Table 6.

Quantitative comparison of the present study with representative prior breathing-pattern classification studies. Cross-study comparison should be interpreted cautiously because the studies differ in sensing modality, class definitions, cohort characteristics, and evaluation methodology.

Study Sensing modality Task / Class. Metric Reported Reported Values
Present Study Wearable IMU + flex sensor 3-class and 6-class breathing-pattern classification Held-out sample accuracy; per-class validation F1

Held-out accuracy: 93.06% (3-class), 78.57% (6-class).

Validation F1 by class (complex transformer, focal loss): deep 0.91, normal 0.93, shallow 0.96 (3-class); coughing 0.88, deep 0.82, hold 0.83, normal 0.81, shallow 0.92, yawning 0.79 (6-class)

McClure et al., 202011 Wearable chest + abdomen inertial sensors (accelerometer + gyroscope) 6 breathing events: normal, central sleep apnea, coughing, obstructive sleep apnea, sighing, yawning Mean F1 score by event 92% normal, 87% central sleep apnea, 72% coughing, 51% obstructive sleep apnea, 57% sighing, 63% yawning
Islam et al., 202424 Non-contact infrared light-wave sensing + optimized 1D-CNN 8 respiration classes Test accuracy 87.33% (with transfer learning)
Purnomo et al., 202125 Non-contact FMCW radar + MFCC + XGBoost 5 breathing waveform classes Classification accuracy 87.375%
Tarim et al., 202326 Wearable device integrated with deep-learning-based breath-pattern analysis Breath-pattern identification Accuracy / sensitivity / specificity 96.0% accuracy, 97.6% sensitivity, 79.7% specificity

A key finding of this study is the benefit of combining IMU and flex sensor data, with the fusion model achieving 93.41% validation accuracy compared with 70.93% when using flex sensor data. This result highlights the importance of mechanical dynamics in breathing classification, suggesting that rotational and accelerometer data capture essential aspects of breathing mechanics that traditional flex-based measurements overlook. Feature analysis from accelerometer based chest motion signals highlighted the importance accelerometer based motion signal for estimation of respiration dynamics27. A survey of the recent architectures of deep convolutional neural networks highlighted that deeper networks and residual connections improve feature learning and model performance28. Which could be used in wearable breathing sensing for more accurate detection and classification of sensor data to extract respiratory patterns.

In terms of architectural performance, the transformer model showed the strongest overall results among the evaluated approaches, achieving 93.06% accuracy versus 89.58% accuracy for CNN-LSTM in the 3-class task. It also maintained an advantage in the more challenging 6-class task (78.57% vs. 74.03%), indicating that this performance advantage was preserved on unseen data within the present study. The attention mechanism’s ability to focus on specific temporal points likely contributed to distinguishing subtle pattern differences. Deep learning models are generally reported in the literature to perform better compared to traditional machine learning approaches such as histogram gradient boosting (HGB), making it suitable for biomedical signal classification29. This suggests that aggregate features such as signal entropy and breathing rate may be less effective for capturing complex temporal relationships in this classification setting.

Additionally, model complexity appears to influence classification performance. More sophisticated implementations performed better than simpler implementations, with the Complex Transformer model achieving 93.41% accuracy compared with 90.70% accuracy for its simpler variant. These results suggest that combining multiple wearable sensors with machine learning can effectively detect important breathing events from physiological signals30.

The classification results provide valuable physiological insights into breathing pattern distinctiveness. The model achieved high accuracy in distinguishing certain patterns, such as coughing (F1 score: 0.91) and shallow breathing (F1 score: 0.88). However, some breathing types present classification challenges, with deep breathing frequently misclassified as yawning (27 instances) and normal breathing often confused with breath-hold (28 instances), particularly during transition periods.

Feature importance analysis further reinforced the value of IMU-derived signals, particularly gyroscope z-axis sensitivity, for distinguishing breathing patterns. The IMU data captured subtle distinctions that flex sensors alone could not detect, and the observed temporal importance patterns aligned with known breathing cycle phases.

In addition to these technical findings, the system may have future relevance for respiratory monitoring applications. The high accuracy of 3-class classification suggests that the proposed framework can distinguish broad respiratory states under controlled conditions. Notably, the model’s strong precision in detecting coughing (0.93 F1 score) suggests possible utility for automated cough frequency monitoring in future studies. Previous worked showed that a lightweight AI model can be used to detect asthma from respiratory and cough sound signals31. Similarly, its ability to detect shallow breathing (F1 score: 0.88) suggests that this pattern may be identifiable within a wearable monitoring framework. AI based frame work previously used to detect shallow breathing patterns from physiological signals32. The system also demonstrated stable performance across different breathing transitions and intensities. Performance remained strong across deep breathing (0.94 F1 score), normal breathing (0.91 F1 score), and shallow breathing (0.95 F1 score), supporting the consistency of the classification framework within the present experimental setting.

Additionally, the model’s generalizability to holdout data suggests that the classification framework retains performance on unseen samples within the present dataset. Broader applications, such as sleep-related monitoring, athletic performance tracking, respiratory therapy assessment, or stress-related breathing analysis, remain possible future directions, which could be possible using wearable sensors33,34. The strong performance of the transformer model appears to stem from its handling of temporal relationships within the breathing cycle. By leveraging self-attention mechanisms, it can capture both local and global dependencies in the signal, which is useful for distinguishing similar patterns. The ability to focus on specific temporal points may provide an advantage in complex pattern classification and likely contributed to its higher accuracy on unseen data.

The feature utilization patterns across the architecture highlight the importance of specific sensor signals. The transformer’s emphasis on gyroscope z-axis measurements suggests that rotational thoracic movement may contain especially useful discriminative information for breathing pattern classification. In a previous study, researchers developed an order transition pattern feature engineering approach to extract important information from physiological signals such as EEG and ECG for improved classification performance35. This contrasts with traditional methods that rely primarily on flex sensor data and aggregate statistics. The CNN-LSTM model, while effective, demonstrated a stronger reliance on aggregate breathing characteristics such as peak-to-trough distances and expiration duration. While achieving 89.58% accuracy in the 3-class task, it struggled with subtle pattern distinctions in the 6-class classification, decreasing to 74.03% accuracy. These results indicate that while sequential features are valuable, the ability to attend to precise temporal points may be especially important for high-performance breathing pattern classification.

Traditional machine learning approaches, such as HGB, also highlight the limitations of relying solely on statistical features. Despite sophisticated feature engineering, the model’s accuracy declined from 83.33% to 58.12% when moving from 3-class to 6-class classification. This performance drop highlights the critical role of learning temporal relationships, especially in complex classification tasks. The consistent hierarchy of performance across architectures suggests that the transformer’s advantages were preserved across the classification settings evaluated in this study. However, the overall decrease in performance with increasing number of classes highlights an inherent challenge in breathing pattern classification, reflecting the difficulty of accurately separating multiple respiratory patterns in multi-class settings36.

Conclusion

This study demonstrates that multimodal sensing combined with modern deep learning techniques can support accurate wearable breathing pattern classification under controlled experimental conditions. The proposed system achieved 93.06% accuracy in three-class breathing pattern classification and 78.57% accuracy in six-class classification on completely unseen data, supporting the feasibility of the sensing and classification framework within the present study. Comparative analysis of different architectures showed that the transformer achieved the strongest overall performance, particularly when IMU and flex data were combined. These findings suggest that rotational thoracic movement, captured via gyroscope measurements, provides useful discriminative information for breathing pattern classification. The substantial performance difference between combined IMU+flex input and flex measurements (93.41% vs. 70.93%) underscores the value of multimodal sensing in this classification setting.

This work makes four main contributions within the scope of the present study. First, it evaluates an AI-integrated wearable and wireless multisensor design that combines an IMU and a flex resistive sensor for breathing pattern classification. Second, it provides a comparative evaluation of deep learning and traditional machine learning methods for multisensor breathing classification, with attention-based architectures showing the strongest performance in this study. Third, it highlights the critical role of inertial sensor data in improving classification accuracy, offering new insights into feature importance for respiratory analysis. Finally, it demonstrates strong performance across the evaluated breathing patterns, achieving particularly strong results for distinctive cases such as coughing (F1: 0.91) and shallow breathing (F1: 0.88). Collectively, these contributions support continued development of intelligent wearable systems for breathing pattern monitoring. The system’s performance across different breathing patterns suggests that the proposed framework is a promising basis for future respiratory monitoring research. While the results are promising, they also point to opportunities for further improvement, particularly in differentiating physiologically similar breathing patterns and evaluating performance in broader and more realistic monitoring conditions. This research establishes a foundation for future work in wearable respiratory monitoring that combines multimodal sensing with modern AI methods. The current study validates the proposed system in a controlled cohort of healthy participants, future work will focus on extending the evaluation to clinical populations with respiratory disorders. These efforts will support the broader goal of developing accessible, noninvasive respiratory monitoring systems for diverse populations and real-world application settings.

Electronic Supplementary Material

Below is the link to the electronic supplementary material.

Supplementary Material 1 (13.5MB, docx)

Acknowledgements

The authors thank WE-SPARK Health Institute through an Igniting Discovery Grant and the Faculty of Engineering Innovating Sustainability Grant for funding. The work of MJA was supported by NSERC through the Discovery Grant. The work of SRG was supported by the Natural Sciences and Engineering Research Council of Canada (NSERC) through the Discovery Grant.

Author contributions

C.C., B., and M.J.A. conceptualizing, designed and developed. C.C., B., B.R.S, and N.J.L, data collection, experimental design, and data analysis. B.R.S. and N.J.L. conducted physiological validation experiments. C.C. contributed to the electronic circuit and sensor integration, testing and algorithm development. A.R.B. and S.A. human respiratory physiology and data interpretation. S.R.-G. and S.A. manuscript review and editing. M.J.A. supervised the project, conceptualized the study, and provided overall guidance. C.C., B., and P.D. prepared the main manuscript text and figures. All authors reviewed and approved the final manuscript.

Funding

WE-SPARK Health Institute through an Igniting Discovery Grant (IDG). NSERC through the Discovery Grants RGPIN-2023-03423 and RGPIN-2022-04428.

Data availability

The datasets generated and/or analysed during the current study are not publicly available due to privacy and ethical restrictions related to human participant data but are available from the corresponding author on reasonable request.

Declarations

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Miller, M. R. et al. Standardisation of spirometry. Eur. Respir J.26 (2), 319–338. 10.1183/09031936.05.00034805 (2005). [DOI] [PubMed] [Google Scholar]
  • 2.Seely, A. J. & Macklem, P. T. Complex systems and the technology of variability analysis, Crit. Care, 8(6), p. R367, (2004). 10.1186/cc2948 [DOI] [PMC free article] [PubMed]
  • 3.Tsouti, V., Kanaris, A. I., Tsoutis, K. & Chatzandroulis, S. Development of an automated system for obstructive sleep apnea treatment based on machine learning and breath effort monitoring. Microelectron. Eng.231, 111376. 10.1016/j.mee.2020.111376 (2020).
  • 4.Kim, D., Lee, J., Park, M. K. et al. Recent developments in wearable breath sensors for healthcare monitoring. Commun Mater 5, 41 (2024). 10.1038/s43246-024-00480-w [Google Scholar]
  • 5.Hussain, T., Ullah, S., Fernández-García, R. & Gil, I. Wearable Sensors for Respiration Monitoring: A Review. Sensors23, 7518. 10.3390/s23177518 (2023). [DOI] [PMC free article] [PubMed]
  • 6.Güntner, A. T. et al. Breath Sensors for Health Monitoring. ACS Sens.4 (2), 268–280. (2019). 10.1021/acssensors.8b00937 [DOI] [PubMed] [Google Scholar]
  • 7.Lan, B. et al. Oct., A Highly Sensitive Coaxial Nanofiber Mask for Respiratory Monitoring Assisted with Machine Learning. Adv. Fiber Mater.6 (5), 1402–1412. (2024). 10.1007/s42765-024-00420-w [Google Scholar]
  • 8.Chen, A. et al. Machine-learning enabled wireless wearable sensors to study individuality of respiratory behaviors. Biosens. Bioelectron.173, 112799. 10.1016/j.bios.2020.112799 (2021). [DOI] [PubMed]
  • 9.Reidy, S., Meier, M. & Holz, C. Respiro: Continuous Respiratory Rate Monitoring During Motion via Wearable Ultra-Wideband Radar, Oct. 29, arXiv: arXiv:2411.08898. (2024). 10.48550/arXiv.2411.08898
  • 10.Kumar, A. K., Ritam, M., Han, L., Guo, S. & Chandra, R. Deep learning for predicting respiratory rate from biosignals. Comput. Biol. Med.144, 105338. 10.1016/j.compbiomed.2022.105338 (2022). [DOI] [PubMed]
  • 11.McClure, K. et al. Classification and Detection of Breathing Patterns with Wearable Sensors and Deep Learning. Sensors20 (22), 6481. 10.3390/s20226481 (2020). [DOI] [PMC free article] [PubMed]
  • 12.Ismail Fawaz, H., Forestier, G., Weber, J., Idoumghar, L. & Muller, P. A. Deep learning for time series classification: a review, Data Min. Knowl. Discov, 33(4), 917–963, (2019). 10.1007/s10618-019-00619-1
  • 13.Hallgarten, P., Bethge, D., Özdenizci, O., Grosse-Puppendahl, T. & Kasneci, E. TS-MoCo: Time-Series Momentum Contrast for Self-Supervised Physiological Representation Learning, Jun. 10, 2023, arXiv: arXiv:2306.06522. 10.48550/arXiv.2306.06522
  • 14.Um, T. T. et al. Nov., Data augmentation of wearable sensor data for parkinson’s disease monitoring using convolutional neural networks, in Proceedings of the 19th ACM International Conference on Multimodal Interaction, Glasgow UK: ACM, pp. 216–220. (2017). 10.1145/3136755.3136817
  • 15.Śmigiel, S., Pałczyński, K. & Ledziński, D. ECG Signal Classification Using Deep Learning Techniques Based on the PTB-XL Dataset, Entropy, 23(9), p. 1121, (2021). 10.3390/e23091121 [DOI] [PMC free article] [PubMed]
  • 16.Lu, Z., Ozek, B. & Kamarthi, S. Transformer encoder with multiscale deep learning for pain classification using physiological signals. Front. Physiol.14, 1294577. 10.3389/fphys.2023.1294577 (2023). [DOI] [PMC free article] [PubMed]
  • 17.Tosi, J., Taffoni, F., Santacatterina, M., Sannino, R. & Formica, D. Performance Evaluation of Bluetooth Low Energy: A Systematic Review. Sensors17 (12), 2898. 10.3390/s17122898 (2017). [DOI] [PMC free article] [PubMed]
  • 18.Nag, A., Mukhopadhyay, S. C. & Kosel, J. Wearable Flexible Sensors: A Review. IEEE Sens. J.17 (13), 3949–3960. 10.1109/JSEN.2017.2705700 (2017). [Google Scholar]
  • 19.Katircioglu-Öztürk, D., Güvenir, H. A., Ravens, U. & Baykal, N. A window-based time series feature extraction method. Comput. Biol. Med.89, 466–486. 10.1016/j.compbiomed.2017.08.011 (2017). [DOI] [PubMed] [Google Scholar]
  • 20.Acharya, J. & Basu, A. Deep Neural Network for Respiratory Sound Classification in Wearable Devices Enabled by Patient Specific Model Tuning. IEEE Trans. Biomed. Circuits Syst. 1–1. 10.1109/TBCAS.2020.2981172 (2020). [DOI] [PubMed]
  • 21.Hong, G. et al. A multi-scale gated multi-head attention depthwise separable CNN model for recognizing COVID-19. Sci. Rep.11 (1). 10.1038/s41598-021-97428-8 (2021). [DOI] [PMC free article] [PubMed]
  • 22.Saxena, S. What is LSTM? Introduction to Long Short-Term Memory, What is LSTM? Introduction to Long Short-Term Memory. Accessed: Jul. 02, 2025. Available: https://www.analyticsvidhya.com/blog/2021/03/introduction-to-long-short-term-memory-lstm/
  • 23.Nhat-Duc, H. & Van-Duc, T. Comparison of histogram-based gradient boosting classification machine, random Forest, and deep convolutional neural network for pavement raveling severity classification. Autom. Constr.148, 104767. 10.1016/j.autcon.2023.104767 (2023).
  • 24.Islam, M. Z., Ekin, S., O’Hara, J. F. & Yen, G. Evolutionary Optimization of 1D-CNN for Non-contact Respiration Pattern Classification, Apr. 16, 2024, arXiv: arXiv:2312.13035. 10.48550/arXiv.2312.13035
  • 25.Purnomo, A. T. et al. Non-Contact Monitoring and Classification of Breathing Pattern for the Supervision of People Infected by COVID-19. Sensors21(9), p. 3172. 10.3390/s21093172 (2021). [DOI] [PMC free article] [PubMed]
  • 26.Tarim, E., Durmuş, A. K., Dalkılıç, E. G. & Sakarya, F. E. A Wearable Device Integrated with Deep Learning-Based Algorithms for the Analysis of Breath Patterns. Adv. Intell. Syst.10.1002/aisy.202300174 (2023). [Google Scholar]
  • 27.Sang, B. et al. An Accelerometer-Based Wearable Patch for Robust Respiratory Rate and Wheeze Detection Using Deep Learning. Biosensors14 (3), 118. 10.3390/bios14030118 (2024). [DOI] [PMC free article] [PubMed]
  • 28.Khan, A., Sohail, A., Zahoora, U. & Qureshi, A. S. A survey of the recent architectures of deep convolutional neural networks. Artif. Intell. Rev.53 (8), 5455–5516. (2020). 10.1007/s10462-020-09825-6 [Google Scholar]
  • 29.Alqudah, A. M. & Moussavi, Z. A Review of Deep Learning for Biomedical Signals: Current Applications, Advancements, Future Prospects, Interpretation, and Challenges. Comput. Mater. Contin. 83 (3), 3753–3841. 10.32604/cmc.2025.063643 (2025). [Google Scholar]
  • 30.Dixon, P. C., Dubeau, S., Roy, J. F. & Fournier, P. A. Automatic cough detection via a multi-sensor smart garment using machine learning. Comput. Biol. Med.191, 110192. 10.1016/j.compbiomed.2025.110192 (2025). [DOI] [PubMed]
  • 31.Xu, S. et al. Automated Lightweight Model for Asthma Detection Using Respiratory and Cough Sound Signals. Diagnostics15 (9), 1155. 10.3390/diagnostics15091155 (2025). [DOI] [PMC free article] [PubMed]
  • 32.Abd-alrazaq, A. et al. Sep., Detection of Sleep Apnea Using Wearable AI: Systematic Review and Meta-Analysis, J. Med. Internet Res., 26, p. e58187, (2024). 10.2196/58187 [DOI] [PMC free article] [PubMed]
  • 33.Van Den Bosch, O. F. C., Alvarez-Jimenez, R., De Grooth, H. J., Girbes, A. R. J. & Loer, S. A. Breathing variability—implications for anaesthesiology and intensive care. Crit. Care. 25 (1). 10.1186/s13054-021-03716-0 (2021). [DOI] [PMC free article] [PubMed]
  • 34.Chen, Y. et al. PhysioWave: A Multi-Scale Wavelet-Transformer for Physiological Signal Representation, Jun. 12, 2025, arXiv: arXiv:2506.10351. 10.48550/arXiv.2506.10351
  • 35.Gelen, M. A. et al. Novel accurate classification system developed using order transition pattern feature engineering technique with physiological signals. Sci. Rep.15 (1). 10.1038/s41598-025-00071-w (2025). [DOI] [PMC free article] [PubMed]
  • 36.LoMauro, A., Colli, A., Colombo, L. & Aliverti, A. Breathing patterns recognition: A functional data analysis approach. Comput. Methods Programs Biomed.217, 106670. 10.1016/j.cmpb.2022.106670 (2022). [DOI] [PubMed]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplementary Material 1 (13.5MB, docx)

Data Availability Statement

The datasets generated and/or analysed during the current study are not publicly available due to privacy and ethical restrictions related to human participant data but are available from the corresponding author on reasonable request.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES