Skip to Content
ElectronicsElectronics
  • Article
  • Open Access

15 April 2026

16 Pages

Tiny Machine Learning Implementation for a Textile-Integrated Breath Rate Sensor

,
,
and
1
Electronic Sensors Unit, Sensor Systems Division, Silicon Austria Labs, 8010 Graz, Austria
2
Department of Electron Devices, Budapest University of Technology and Economics, 1117 Budapest, Hungary
*
Author to whom correspondence should be addressed.

Abstract

Respiratory rate (RR) is a critical indicator of physiological status, yet unobtrusive and continuous RR monitoring remains challenging, particularly in wearable applications that require soft, lightweight, and low-power sensing systems. This paper presents an integrated approach that combines a textile-embedded embroidered strain-gauge sensor with Tiny Machine Learning (TinyML) to enable real-time, on-device RR estimation. The sensing platform consists of a textile-integrated meander-pattern strain gauge and a fabric-mounted analog readout circuit, which together capture thoracic expansion during breathing. Two lightweight neural network models—a convolutional neural network (CNN) operating on raw respiratory waveforms and a dense neural network (DNN) operating on wavelet features—were developed and trained using a public strain-sensor dataset and a custom dataset collected with the textile system (TexHype dataset). Both models were optimized through 8-bit quantization and deployed to an STM32L4 microcontroller, where end-to-end on-device preprocessing, filtering, segmentation, normalization, and inference were performed. The CNN achieved the highest accuracy, with a mean absolute error (MAE) of 1.23 breaths per minute (BPM) on the TexHype dataset, but exhibited substantial inference latency (5.8–6.2 s) due to its computational complexity. In contrast, the wavelet-based DNN demonstrated lower accuracy (MAE 2.21 BPM) but achieved real-time performance with inference times of 18–96 ms, and a power overhead ( Δ P = P active − P idle ) of approximately 3.3 mW during inference. Cross-dataset testing revealed limited generalization between different strain-sensor platforms. The findings highlight key trade-offs between accuracy, latency, and energy efficiency, and illustrate the potential of combining stretchable electronics with embedded intelligence to enable next-generation wearable respiratory monitoring systems.

1. Introduction

RR is a key physiological parameter and one of the earliest indicators of respiratory or cardiovascular deterioration [1,2,3]. Continuous monitoring of RR can support timely detection of clinical deterioration, enable long-term health management, and provide valuable insights in sports and occupational performance. Despite its importance, routine RR assessment remains challenging [4,5,6]. Conventional approaches such as spirometry, capnography, and impedance pneumography provide accurate measurements but require clinical supervision, rigid hardware, or direct facial or thoracic attachments, limiting their suitability for everyday or prolonged wearable use [7,8].
Advances in flexible electronics and textile integration have driven the development of unobtrusive wearable respiratory sensors [9]. Various sensing modalities have been explored—including resistive sensors that measure strain-induced resistance changes [10], capacitive sensors that detect variations in capacitance due to chest expansion [11], pressure sensors that capture mechanical deformation [12], acoustic sensors that analyze breathing sounds [13], humidity sensors that monitor moisture changes in exhaled air [14], and inertial sensors that track body motion associated with respiration [15]—each offering distinct benefits and limitations. Resistive and strain-based sensors, particularly those embedded directly into fabrics through knitting, embroidery, or printing, are especially promising for monitoring thoracic expansion due to their mechanical compliance, comfort, and seamless integration into garments [16,17]. Recent studies have shown feasibility for respiration tracking using knitted silver-plated fabrics [18], printed strain gauges [17], and carbon-black elastomer sensors [10] integrated into belts or clothing. However, these systems sometimes suffer from motion sensitivity, baseline drift, and variability across users or postures.
Most wearable respiration studies rely on classical RR estimation algorithms operating either in the frequency domain (e.g., FFT-based dominant frequency estimation) or the time domain (e.g., peak detection, zero-crossing analysis) [19]. Frequency-domain approaches perform well for periodic breathing but degrade when the respiratory pattern becomes irregular or when motion artifacts shift spectral content [20,21]. Time-domain approaches are computationally efficient and suitable for embedded use but depend on carefully tuned thresholds and robust filtering [22]. Overall, studies show that while time-domain methods outperform frequency-based approaches, both categories struggle with non-periodic breathing, motion artifacts, and signal variability—common in real-world wearable use.
Machine learning (ML) and deep learning (DL) have emerged as powerful alternatives capable of learning complex breathing patterns directly from raw or minimally processed signals. Models such as CNNs, LSTMs, and hybrid architectures have achieved state-of-the-art RR estimation performance, particularly from photoplethysmography (PPG) and electrocardiogram (ECG) signals [23,24,25,26]. However, these models typically rely on offline computation or cloud-based inference. Such dependence introduces privacy concerns, communication latency, and elevated energy consumption—factors incompatible with battery-powered wearable platforms [27]. In addition, these studies rely on cardiovascular-derived signals (e.g., PPG and ECG) rather than direct respiratory measurements from chest expansion, creating a mismatch between wearable textile strain sensors and most commonly available public datasets used to train ML models for RR estimation.
TinyML addresses this challenge by enabling on-device sensor data analytics (audio, vision, IMU, biomedicals, etc.) at extremely low power, typically in the mW range and below, hence enabling a wide variety of always-on use-cases targeting resource constrained embedded devices such as microcontrollers, ASICs, FPGAs and other DSP-embedded subsystems [28,29]. Recent works have demonstrated TinyML for applications such as heart-rate estimation [30], ECG arrhythmia classification [31], and respiratory-disease detection using gas or acoustic sensors [32,33]. These studies show that carefully optimized neural networks can achieve useful performance within strict memory and computational constraints. Yet, the application of TinyML specifically to RR estimation remains extremely limited. Even fewer studies evaluate TinyML in combination with stretchable or textile-integrated sensors, and real-world documentation of on-device latency, power consumption, and memory usage is sparse. Most TinyML studies rely on toolchain estimates rather than measured hardware performance, leaving important practical trade-offs underexplored.
This work investigates the feasibility of performing real-time RR estimation using a textile-integrated embroidered strain gauge, embedded readout electronics, and a TinyML pipeline deployed on an STM32 microcontroller. A public dataset and a custom dataset using the TexHype sensor were used to train and evaluate two lightweight neural network models: a CNN applied to raw signals, and a DNN applied to wavelet-transformed features. The complete system integrates on-device filtering, segmentation, normalization, and quantized inference. The contributions of this work are as follows:
1.
Integration of a textile-embedded embroidered strain-gauge sensor and flexible readout circuitry for unobtrusive respiration monitoring.
2.
Development and comparison of two lightweight neural architectures (CNN and DNN) tailored for embedded RR estimation.
3.
Implementation of a full TinyML inference pipeline on a resource constrained microcontroller, including real-time FIR filtering, feature buffering, normalization, and quantized model execution.
4.
Experimental comparison of accuracy, generalization, inference latency, memory footprint, and power overhead during inference, illustrating the practical trade-offs between model complexity and deployability.
5.
Demonstration that TinyML can be successfully combined with stretchable textile sensors for real-time RR estimation, providing a foundation for next-generation low-power wearable respiratory monitoring systems.
The remainder of this paper is structured as follows: Section 2 presents the materials and methods, including the Tex-Hype sensor system, dataset collection, preprocessing pipeline, neural network architectures, and embedded deployment. Section 3 presents the experimental results, including model performance, cross-dataset evaluation, and on-device deployment metrics. Section 4 discusses the key findings, trade-offs, and limitations of the proposed approach. Finally, Section 5 concludes the paper and outlines directions for future work.

2. Materials and Methods

2.1. Tex-Hype Breath Rate Sensor System

The primary hardware utilized in the implementation of this work is the textile-integrated breath rate sensor system “Tex-Hype BR sensor” developed as part of the Tex-Hype project at Silicon Austria Labs (SAL) [34,35]. At a high level, the system consists of three main components: a textile-integrated embroidered strain-gauge sensor, an analog readout circuitry, and a low-power STM32 microcontroller, as illustrated in Figure 1. The system was designed to capture thoracic expansion during breathing and execute end-to-end signal processing and RR estimation directly on the embedded device. More details about the system can be found under [36].
Figure 1. High-level block diagram of the textile-integrated breath rate (BR) sensor system, illustrating the flow of the respiratory signal from the embroidered strain-gauge sensor through the analog readout circuitry to the microcontroller.

2.2. Dataset Collection

Two primary datasets have been utilized in the evaluation of this work, namely:
1.
Public dataset: WoW dataset [37].
2.
Custom dataset: Tex-Hype dataset.
The following subsections provide a detailed explanation of the rationale behind the selection of the public dataset and the methodology employed in the acquisition of the custom dataset.

2.2.1. WoW Dataset

Several publicly available respiration datasets including those commonly utilized in the literature—such as BIDMC [38], MIMIC-II [39], and CapnoBase [40]—were evaluated for suitability in this work. However, these datasets primarily contained PPG or ECG respiratory signals, which differ significantly from the strain-based sensing modality employed in the present study. The WoW dataset was therefore selected as the primary public dataset, as it offers respiratory signals captured using printed, thin-film, and stretchable skin-mounted strain gauges, making it mechanically and functionally more comparable to the textile-integrated sensor used in this work. The WoW dataset was collected by the Institute of Systems and Robotics at the University of Coimbra as part of the CMU-Portugal WoW project, and includes respiration recordings from four subjects in various postures, alongside ground-truth signals obtained from a nose-mounted thermistor.

2.2.2. Tex-Hype Dataset

The Tex-Hype dataset consists of data acquired using the Tex-Hype BR sensor. The data acquisition procedure employed is consistent with methods commonly reported in literature. A total of 5 volunteers, aged between 20 and 40 years, were recruited for data collection, and informed consent was obtained from all participants ensuring they understood the purpose of the study, the type of data being collected, and the potential risks. To comply with GDPR and ensure ethical standards, all data was anonymized.
Respiratory signals were collected with the TexHype BR sensor positioned around the lower chest. Data were sampled at 10 Hz, a rate selected to satisfy Nyquist requirements while providing sufficient temporal resolution to capture typical adult respiratory dynamics [36]. Recordings were performed under two postures—sitting and standing—to capture natural variability in breathing patterns. Participants were instructed to breathe normally without intentional modulation. To obtain ground-truth labels, subjects pressed an onboard button at each peak inhalation. While this approach enables intuitive and unobtrusive annotation during data acquisition, it introduces inherent timing uncertainty due to human reaction delay. To address this, the recorded annotations were visually inspected and corrected during post-processing to ensure consistent identification of respiratory cycles. All recorded data were stored on an SD card and subsequently transferred to a PC for data cleaning and preprocessing steps.

2.3. Data Preprocessing

All recordings underwent a structured preprocessing pipeline designed to enhance signal quality, ensure consistency across datasets, and generate reliable labels for supervised learning. The workflow consisted of four primary stages: data cleaning, filtering, segmentation, and normalization, followed by dataset-specific labelling procedures.
1.
Data cleaning: Raw signals exported from the microcontroller contained whitespace, non-numeric characters, and occasional formatting artifacts generated during file writing. These were removed to prevent parsing errors and to ensure compatibility with Python 3.10 analysis tools (including Pandas, NumPy, Matplotlib, and Scipy libraries). Cleaned data were converted from .txt to structured .csv format with explicit column headers, to enable efficient data handling and establish a uniform data representation for subsequent processing.
2.
Data filtering: To isolate respiration-related dynamics, a 0.1–1 Hz Butterworth bandpass filter was applied to all recordings. This passband corresponds to 6–60 breaths per minute, encompassing the full physiological range expected during resting and mild activity while attenuating low frequency drift from posture shifts or garment movement, and high frequency noise introduced by the sensor or environment.
3.
Data segmentation: Following filtering, the data were partitioned into 30 s segment (300 samples at 10 Hz). This window length offers a practical balance between temporal resolution and computational efficiency—sufficiently long enough to capture multiple respiratory cycles [19,25], while remaining short enough for TinyML models. Finally, non-informative portions of each recording were trimmed to remove initialization artifacts.
4.
Data normalization: Each segment was normalized using min-max scaling to the range [0, 1]. The primary purpose of this stage is to ensure that sections with larger ranges do not dominate those with smaller ones by utilizing the same scale for all segments of the data. By rescaling the data, the models can converge faster, which improves performance and reduces the risk of numerical instability.
5.
Data labelling: Two distinct strategies were used depending on the dataset.
  • WoW Dataset: Since the WoW dataset did not include respiration labels, inhalation peaks were identified using a peak detection algorithm. Minimum prominence and inter-peak distance thresholds were empirically selected to robustly detect respiration cycles across subjects. RR for each 30 s window was computed from the detected peak count and manually verified to ensure annotation accuracy.
  • TexHype Dataset: Ground truth was acquired during recording by instructing participants to press an onboard button at each inhalation peak. These timestamps were aligned with the respiratory waveform and counted within each segment to compute RR. Segments containing missed button presses were visually inspected and corrected to ensure consistent high-quality labels.

2.4. Neural Network Architecture

Two lightweight neural network architectures were developed to enable efficient respiratory-rate estimation on resource-constrained microcontrollers. The models were chosen to reflect two complementary design philosophies: (1) a convolutional neural network (CNN) that learns temporal features directly from raw respiratory waveforms and (2) a compact dense neural network (DNN) that operates on hand-crafted wavelet features to minimize computational overhead. Both architectures were implemented and trained using the Edge Impulse platform [41], to enable seamless quantization and deployment for the embedded hardware.
The selection of wavelet-based features in this study is motivated by their demonstrated effectiveness for non-stationary biomedical signals [42] and their computational efficiency for embedded deployment. Prior studies, such as [19], have already provided comprehensive comparisons of feature extraction techniques and conventional algorithms for respiratory rate estimation. Therefore, this work focuses on evaluating two distinct modeling approaches—raw-signal learning using a CNN and feature-based learning using a DNN—under resource-constrained conditions, rather than exhaustively comparing feature extraction methods.

2.4.1. CNN Architecture (Using Raw Signal Input)

The first neural network architecture as shown in Figure 2a consists of stacked 1D convolutional layers with progressively increasing filter depths (32, 64, 128, and 256 filters, each using a kernel size of 3 and ReLU activation), each followed by max-pooling layers to reduce temporal dimensionality and enhance feature abstraction. The convolutional stack is connected to a single regression output neuron producing a continuous estimate of RR. This architecture leverages the ability of CNNs to learn local temporal correlations, making it well suited for raw strain-sensor waveforms exhibiting periodic structure but also noise and small variations across subjects. Lastly, dropout regularization (0.25) was applied to mitigate overfitting.
Figure 2. Model architecture. (a) Model 1: Convolutional neural network (CNN) architecture with raw signal as input. (b) Model 2: Dense neural network (DNN) architecture with wavelet transformed feature vector as input.

2.4.2. DNN Architecture (Using Wavelet Features Input)

The second neural network architecture as shown in Figure 2b consists of two fully connected dense layers (with 40 and 20 neurons respectively) connected to a single neuron output, with a dropout of 0.25. The DNN model operates on hand-engineered features extracted using wavelet transformation, which has been reported in literature [42] to be an effective feature extraction technique for non-stationary biomedical signals, such as respiration, due to its ability to provide localized frequency content. This transformation was implemented using Edge Impulse’s spectral analysis block and produced a compact 56-dimensional feature vector from each 30 s window.

2.5. Model Training and Testing

Model training was carried out within Edge Impulse, as it provided a streamlined interface for tuning model parameters and monitoring performance. Each neural network model was trained using a supervised regression framework to predict the respiratory rate (RR) from each 30 s segment. After preprocessing, each dataset (WoW and TexHype) were partitioned into training and testing subsets using an 80/20 split, with an internal 20% fraction applied during training to monitor model convergence and reduce overfitting. The following training configuration was used across all experiments to ensure fair comparison between models: optimizer— adam, loss function—mean absolute error (MAE), batch size—32, epochs—100, and learning rate—0.005.
After training, models were tested on the held-out test sets, to verify the trained model’s ability to generalize beyond the training set. Given the limited number of subjects in the TexHype dataset (5 subjects), leave-one-subject-out (LOSO) cross-validation was not adopted, as it would result in high variance and unreliable estimates. Instead, cross-dataset evaluation was performed, providing a more stringent assessment of generalization across different subjects, sensing modalities, and acquisition conditions. More specifically, cross-dataset evaluation was conducted to assess how well models trained using data from the WoW dataset would generalize to data from the Tex-Hype dataset and to determine its suitability for live deployment on the TexHype BR system. Lastly, the trained models were evaluated to assess their performance, and robustness using the following metrics: MAE, MSE, and R2 score. MAE and MSE quantify prediction errors, where lower values indicate better accuracy (with MSE penalizing larger errors), while R2 score evaluates goodness of fit, with values closer to 1 indicating stronger predictive performance.

2.6. Model Optimization and Deployment

To enable real-time RR estimation on the resource-constrained wearable hardware the trained models (on the TexHype dataset) were optimized by converting from floating-point data representation to 8-bit integer (int8) using a post training quantization technique. Model optimization focused on reducing computation complexity, memory footprint, and power overhead while preserving regression accuracy. The quantized models were then exported as CMSIS-NN compatible C/C++ libraries and imported into the STM32cubeIDE project for this study targeting the STM32L4R9 microcontroller. These libraries made it possible for the trained models to be referenced as function calls in the developed code.
Figure 3 illustrates the deployed TinyML pipeline. To ensure consistency between training and inference, the preprocessing pipeline was replicated on-device using the same processing steps and parameterization as the offline pipeline used during training. Minor numerical differences may arise due to embedded implementation constraints; however, these are expected to have negligible impact on the resulting feature representation and model performance.
Figure 3. Functional block diagram of the deployed end-to-end TinyML pipeline implemented on the microcontroller. The pipeline includes signal acquisition, FIR filtering, feature buffering, normalization, and on-device inference.
Respiratory signals acquired from the embroidered strain sensor were sampled at 10 Hz using the microcontroller’s ADC with DMA support to minimize CPU overhead. A finite impulse response (FIR) bandpass filter with a passband of 0.1–1 Hz was implemented using the CMSIS-DSP library to suppress baseline drift and high-frequency noise while preserving respiration-related signal components. Filtered samples were stored in a circular buffer until a complete 30 s window (300 samples) was accumulated. Each window was normalized using min-max scaling to the range [0, 1] before being passed to the embedded neural network for inference.
For the CNN model, the normalized raw signal served directly as input, whereas for the DNN model, wavelet-based features were computed prior to inference, consistent with the feature extraction used during training. Inference was executed entirely on the microcontroller without reliance on external computation or communication. Execution time was measured using internal hardware timers to capture inference latency under realistic operating conditions, while memory usage was evaluated as the total flash usage of the compiled firmware.
The power overhead during inference is quantified as Δ P = P active − P idle representing the additional power introduced by on-device model execution (inference). Power consumption measurements were performed by monitoring the microcontroller current consumption (IDD) using the built-in IDD measurement circuit available on the STM32L4R9 board, as described in the device datasheet. This on-board measurement capability allows direct observation of the MCU current consumption in run and low-power modes. The active power corresponds to the device consumption during model inference, while the idle power was measured when the system was operating without executing the model. All measurements were conducted under consistent operating conditions, with the supply voltage maintained within the recommended range (≤3.3 V), to ensure reliable and comparable results.

3. Results

3.1. Dataset Characteristics and Signal Quality

The TexHype breath rate sensor produced respiratory waveforms characterized by periodic oscillations corresponding to thoracic expansion and contraction as shown in Figure 4. Raw signals acquired exhibited baseline drift and amplitude variability across subjects and postures, primarily due to sensor tension, garment fit, and body movements. After application of the 0.1–1 Hz bandpass filter, respiratory cycles became more clearly distinguishable, with reduced low-frequency drift and high-frequency noise. Segmented 30 s windows consistently contained multiple respiratory cycles, providing stable input for subsequent training and inference.
Figure 4. Example outputs of the respiratory signal preprocessing pipeline, showing the transformation from raw input to filtered and normalized signals.

3.2. Model Training

The loss curves generated following the training of the models on both datasets are presented in Figure 5 and Figure 6. As can be observed, the models trained on the WoW dataset successfully converge and stabilize after approximately 10 epochs, whereas models trained on the TexHype dataset converge after approximately 20 epochs. Overall, the training and validation curves remain relatively stable and closely correlated throughout the remaining epochs, indicating that the models are able to learn from both datasets without evidence of overfitting.
Figure 5. Training and validation loss curves for models trained on the WoW dataset: (a) CNN model; (b) DNN model.
Figure 6. Training and validation loss curves for models trained on the TexHype dataset: (a) CNN model; (b) DNN model.

3.3. Model Testing and Cross-Dataset Evaluation

The test performance of the trained models on the held-out test sets from both the WoW and TexHype datasets are summarized in Table 1. On the WoW dataset, the CNN model achieved lower MAE and MSE values and a higher R2 Score compared to the DNN model. Similarly, on the TexHype dataset, the CNN model achieved lower MAE and MSE values and a higher R2 Score compared to the DNN model. Overall, both models achieved better performance on the TexHype dataset compared to the WoW dataset.
Table 1. Performance comparison of CNN and DNN models on the WoW and TexHype datasets.
Finally, to assess cross-dataset generalization, models trained on the WoW dataset were further tested on the TexHype dataset. The results of this evaluation are summarized in Table 2. A noticeable reduction in performance across all metrics can be observed in both the DNN and CNN models.
Table 2. Cross-dataset evaluation results of models trained on the WoW dataset and tested on the TexHype dataset.

3.4. Model Optimization and Deployment

A summary of the deployment performance of the models on the target device is presented in Table 3. The table reports the actual on-device performance and compares it with the corresponding estimates generated in the Edge Impulse environment prior to deployment.
Table 3. Comparison of estimated and actual deployment performance for CNN and DNN models (trained and tested on the TexHype dataset).

4. Discussion

4.1. Interpretation of Findings

The primary objective of this work was to investigate the potential of TinyML for real-time on-device respiratory rate estimation with the TexHype breath rate sensor, given the resource constraints of computation, memory, storage, internet connectivity, and power. This involved collecting suitable respiratory datasets to train lightweight neural network models for edge deployment. FFT analysis of the acquired datasets—WoW, and TexHype datasets—confirmed the presence of baseline drift, motion artifacts and noise. To address this, several data preprocessing steps were employed to improve signal quality prior to model training. The results presented in Figure 4 show that the data preprocessing steps employed—data cleaning, filtering, segmentation, and normalization—were effective in isolating the respiratory components, improving signal quality, and scaling features ahead of model training.
The light-weight deep learning models developed—CNN and DNN architectures—both achieved high performance metrics when trained and tested on individual datasets (Table 1). The CNN models consistently outperformed the DNN models in all post-training evaluations, achieving a test MAE of 1.61 and 1.23 on the WoW and TexHype datasets, respectively, with corresponding R2 Scores of 0.75 and 0.85. The superior performance of the CNN models may be attributed to their ability to identify local patterns or features within the respiratory data. Unlike the DNN model, which relied on hand-engineered wavelet-transformed features, the CNN model leveraged multiple 1D convolutional layers to extract hierarchical patterns associated with inhalation and exhalation cycles. This design preserved temporal locality and enabled the model to detect subtle variations in respiratory rhythm that may have been lost in pre-processed feature representations.
However, cross-dataset generalization was a challenge. Models trained on the WoW dataset performed poorly on the TexHype dataset, with the CNN’s MAE rising to 8.34 bpm and R2 score dropping to 0.32 (Table 2). This performance drop—despite the use of similar sensing modality—may be explained by the well-known domain shift problem in biosignal ML applications [43], which limit the ability of ML models trained on one dataset to generalize effectively to signals from other datasets. In this case, the WoW and TexHype datasets differed in both sensing hardware (patch-based vs textile-integrated strain sensors) and participant profiles, leading to divergences in signal morphology and artifact patterns that the models may not have been able to reconcile. This outcome highlights the critical importance of subject diversity and sensor-specific training during model development.
Deployment results (Table 3) demonstrate that both quantized models fit within the memory constraints and run reliably on the target microcontroller. The ADC successfully acquires respiratory signals from the TexHype breath rate sensor, and the on-device FIR filter effectively attenuates noise and baseline drift while populating the feature buffer, which is used by the deployed model to perform inference. On-device evaluation revealed substantial inference latency for the CNN model, with actual runtimes ranging from 5.8 to 6.2 s. Although the CNN exhibits a latency of approximately 6 s, this remains within an acceptable range for respiratory monitoring, as breathing is a low-frequency physiological signal and reliable estimation typically requires observing one or more respiratory cycles. In contrast, the DNN model demonstrated significantly faster inference time (18–96 ms), suggesting that while it is less accurate (MAE: 2.21 bpm), it may be more practical for real-time deployment scenarios that prioritize latency. Additionally, the DNN model exhibited lower power overhead compared to the CNN model. This may be attributed to its simpler architecture, reduced parameter count, and shorter inference duration, all of which contribute to reduced processing load and energy demand during operation.

4.2. Comparison of Results with Existing Studies

The results obtained in this study demonstrate that the proposed TinyML models for respiratory rate estimation using the the TexHype breath rate sensor are competitive with state-of-the-art solutions, despite using a different sensing modality and running on a resource-constrained hardware. The CNN and DNN models achieved MAEs of 1.23 bpm and 2.21 bpm, respectively, which fall within the range (1.24–3.30 bpm) reported for leading deep learning models trained on PPG signals for RR estimation, such as RRWaveNet [25] (1.52–1.59 bpm), and the CNN-LSTM model by Chin et al. [26] (1.24–2.02 bpm), although these approaches were not deployed on embedded systems. In contrast, most RR estimation models in the literature operate offline or in cloud-based environments and do not address deployment limitations such as memory, latency, and power constraints.
From a TinyML perspective, the proposed models align well with other lightweight embedded solutions in healthcare. For instance, the DNN model in this work achieved a low inference latency (18–96 ms) and maintained a small memory footprint (22.2 KB RAM), comparable to Ooko et al.’s [32] breath-based diagnostic model (15.7 KB RAM, 6 ms latency) and Abadade et al.’s [33] auscultation-based lung classification system (12KB RAM, 127 ms latency). While the CNN model offered lower MAE and comparable memory fit, it suffered from a substantial latency overhead (5837–6212 ms), highlighting the tradeoff between model complexity and deployability on embedded systems—a trend also observed in other TinyML studies.

4.3. Limitations and Future Directions

Cross-dataset generalization was a challenge in this study. Models trained on the WoW dataset performed poorly on the TexHype dataset, with the CNN’s MAE rising to 8.34 bpm and R2 score dropping to 0.32 (Table 2). This performance drop—despite the use of similar sensing modalities—may be attributed to the well-known domain shift problem in biosignal ML applications [43], which limits the ability of models trained on one dataset to generalize effectively to signals from another. In addition, the TexHype dataset was limited to recordings from five volunteers, which may constrain generalization across a broader population. For commercial or general-purpose applications, it would be beneficial to extend data collection to include a greater number of participants to improve model robustness. Furthermore, data acquisition was restricted to resting conditions; collecting data under dynamic conditions, such as walking or physical activity, would improve the robustness and applicability of the solution in real-world scenarios. A further limitation inherent to TinyML deployment is the trade-off between model accuracy, computational complexity, and deployability on resource-constrained wearable hardware. More complex model architectures may yield higher estimation accuracy, but their increased parameter count results in greater inference latency and higher computational demands—factors that are incompatible with the memory and power constraints of microcontroller-based wearable platforms. Conversely, lightweight models offer better efficiency and lower latency at the cost of reduced accuracy. Navigating this trade-off remains a fundamental challenge in embedded machine learning.
Future work should focus on domain adaptation and transfer learning to improve cross-dataset generalization, expand data collection to include diverse subjects and activity conditions, and integrate multimodal sensing (sensor fusion) to enhance reliability. Exploring advanced model optimization techniques and conducting long-term clinical validation will also be essential for practical deployment.

5. Conclusions

In conclusion, this work demonstrated the feasibility of real-time respiratory rate (RR) estimation using a textile-integrated embroidered strain-gauge sensor—developed within the Tex-Hype project at Silicon Austria Labs—combined with an end-to-end TinyML pipeline deployed on a low-power microcontroller. The study presented a fully integrated wearable system, including sensor acquisition, signal preprocessing, and on-device inference, enabling continuous RR monitoring without external computation.
Two lightweight neural network architectures—a CNN operating on raw respiratory signals and a DNN based on wavelet features—were developed and systematically evaluated, providing insight into the trade-offs between model complexity, accuracy, and deployability. While the CNN achieved higher estimation accuracy (MAE: 1.23 bpm), it exhibited higher inference latency (5837–6212 ms) and increased power overhead during inference (3.3–6.6 mW). In the context of respiratory monitoring, however, this latency remains within a practically acceptable range, as respiration is a low-frequency physiological signal and reliable estimation typically requires observation over multiple breathing cycles. Consequently, the CNN remains suitable for continuous monitoring and trend analysis, although it is less appropriate for applications requiring rapid or near-instantaneous feedback. In contrast, the DNN demonstrated lower accuracy (MAE: 2.21 bpm) but achieved significantly faster inference (18–96 ms), reduced memory usage (22.2 KB RAM, 120.6 KB flash), and lower power overhead during inference (<3.3 mW), making it more suitable for latency-sensitive wearable applications.
Furthermore, the study highlighted key challenges in cross-dataset generalization, emphasizing the importance of sensor-specific data for robust model performance. Overall, the results establish that combining stretchable textile sensors with embedded machine learning is a viable approach for low-power, real-time respiratory monitoring, and provide a foundation for the future development of efficient and scalable wearable health systems.

Author Contributions

Conceptualization, K.E., R.H., F.E. and G.K.; Methodology, K.E., R.H., F.E. and G.K.; Software, K.E. and G.K.; Validation, K.E.; Formal analysis, G.K.; Investigation, K.E., R.H. and G.K.; Resources, R.H. and G.K.; Data curation, K.E.; Writing—original draft, K.E. and G.K.; Writing—review & editing, K.E., R.H. and F.E.; Visualization, K.E. and G.K.; Supervision, R.H., F.E. and G.K.; Project administration, R.H. and G.K.; Funding acquisition, R.H. All authors have read and agreed to the published version of the manuscript.

Funding

This work has been jointly supported by the Austrian Research Promotion Agency FFG (Osterreichische Forschungsforderungsgesellschaft) Under Project number 883859, titled TEX-hype and by Silicon Austria Labs (SAL), owned by the Republic of Austria, the Styrian Business Promotion Agency (SFG), the federal state of Carinthia, the Upper Austrian Research (UAR), and the Austrian Association for the Electric and Electronics Industry (FEEI).

Data Availability Statement

The TexHype data set used to train the models in the study can be found in a public repository under the link: https://git.silicon-austria.com/ELS/texhype_respiratory_rate_dataset (accessed 9 April 2026). For the source code and models of the study, please contact the corresponding author.

Acknowledgments

ChatGPT-4o (Omni) was used for proofreading and contributed to the generation of 1 conceptual figure.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
RRRespiratory Rate
BRBreath Rate
MLMachine Learning
DLDeep Learning
DNNDeep Neural Network
CNNConvolutional Neural Network
ADCAnalog to Digital Converter
SWVSerial Wire Viewer
MAEMean Absolute Error
MSEMean Squared Error
R2 ScoreCoefficient of Determination

References

  1. Sowho, M.; Amatoury, J.; Kirkness, J.P.; Patil, S.P. Sleep and Respiratory Physiology in Adults. Clin. Chest Med. 2014, 35, 469–481. [Google Scholar] [CrossRef] [Scilit]
  2. Loughlin, P.C.; Sebat, F.; Kellett, J.G. Respiratory Rate: The Forgotten Vital Sign—Make It Count! Jt. Comm. J. Qual. Patient Saf. 2018, 44, 494–499. [Google Scholar] [CrossRef] [Scilit]
  3. Cretikos, M.A.; Bellomo, R.; Hillman, K.; Chen, J.; Finfer, S.; Flabouris, A. Respiratory rate: The neglected vital sign. Med. J. Aust. 2008, 188, 657–659. [Google Scholar] [CrossRef] [Scilit]
  4. Nicolò, A.; Massaroni, C.; Schena, E.; Sacchetti, M. The Importance of Respiratory Rate Monitoring: From Healthcare to Sport and Exercise. Sensors 2020, 20, 6396. [Google Scholar] [CrossRef] [Scilit]
  5. Nicolò, A.; Massaroni, C.; Passfield, L. Respiratory Frequency during Exercise: The Neglected Physiological Measure. Front. Physiol. 2017, 8, 922. [Google Scholar] [CrossRef] [Scilit]
  6. Nicolò, A.; Girardi, M.; Bazzucchi, I.; Felici, F.; Sacchetti, M. Respiratory frequency and tidal volume during exercise: Differential control and unbalanced interdependence. Physiol. Rep. 2018, 6, e13908. [Google Scholar] [CrossRef] [Scilit]
  7. Liu, H.; Allen, J.; Zheng, D.; Chen, F. Recent development of respiratory rate measurement technologies. Physiol. Meas. 2019, 40, 07TR01. [Google Scholar] [CrossRef] [Scilit]
  8. Hussain, T.; Ullah, S.; Fernández-García, R.; Gil, I. Wearable Sensors for Respiration Monitoring: A Review. Sensors 2023, 23, 7518. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  9. Vitazkova, D.; Foltan, E.; Kosnacova, H.; Micjan, M.; Donoval, M.; Kuzma, A.; Kopani, M.; Vavrinsky, E. Advances in Respiratory Monitoring: A Comprehensive Review of Wearable and Remote Technologies. Biosensors 2024, 14, 90. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  10. Jayarathna, T.; Gargiulo, G.D.; Breen, P.P. Continuous Vital Monitoring During Sleep and Light Activity Using Carbon-Black Elastomer Sensors. Sensors 2020, 20, 1583. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  11. Whitlock, J.; Sill, J.; Jain, S. A-spiro: Towards continuous respiration monitoring. Smart Health 2020, 15, 100105. [Google Scholar] [CrossRef] [Scilit]
  12. Reinvuo, T.; Hannula, M.; Sorvoja, H.; Alasaarela, E.; Myllyla, R. Measurement of respiratory rate with high-resolution accelerometer and emfit pressure sensor. In Proceedings of the 2006 IEEE Sensors Applications Symposium, Houston, TX, USA, 7–9 February 2006; pp. 192–195. [Google Scholar] [CrossRef] [Scilit]
  13. Yatani, K.; Truong, K.N. BodyScope: A wearable acoustic sensor for activity recognition. In Proceedings of the 2012 ACM Conference on Ubiquitous Computing; UbiComp ’12; Association for Computing Machinery: New York, NY, USA, 2012; pp. 341–350. [Google Scholar] [CrossRef] [Scilit]
  14. Pang, Y.; Jian, J.; Tu, T.; Yang, Z.; Ling, J.; Li, Y.; Wang, X.; Qiao, Y.; Tian, H.; Yang, Y.; et al. Wearable humidity sensor based on porous graphene network for respiration monitoring. Biosens. Bioelectron. 2018, 116, 123–129. [Google Scholar] [CrossRef] [Scilit]
  15. Jortberg, E.; Silva, I.; Bhatkar, V.; McGinnis, R.S.; Sen-Gupta, E.; Morey, B.; Wright, J.A., Jr.; Pindado, J.; Bianchi, M.T. A novel adhesive biosensor system for detecting respiration, cardiac, and limb movement signals during sleep: Validation with polysomnography. Nat. Sci. Sleep 2018, 10, 397–408. [Google Scholar] [CrossRef] [Scilit]
  16. Liu, Y.; Wang, M.; Yu, M.; Xia, B.; Ye, T. Embroidered Inductive Strain Sensor for Wearable Applications. In Proceedings of the 2020 IEEE International Conference on Pervasive Computing and Communications Workshops (PerCom Workshops), Austin, TX, USA, 23–27 March 2020; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  17. Thiyagarajan, K.; Rajini, G.K.; Maji, D. Flexible, Highly Sensitive Paper-Based Screen Printed MWCNT/PDMS Composite Breath Sensor for Human Respiration Monitoring. IEEE Sens. J. 2021, 21, 13985–13995. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  18. Molinaro, N.; Massaroni, C.; Presti, D.; Saccomandi, P.; Tomaso, G.; Zollo, L.; Perego, P.; Andreoni, G.; Schena, E. Wearable Textile Based on Silver Plated Knitted Sensor for Respiratory Rate Monitoring. In Proceedings of the 2018 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Honolulu, HI, USA, 18–21 July 2018; Volume 2018, pp. 2865–2868. [Google Scholar] [CrossRef] [Scilit]
  19. Charlton, P.H.; Bonnici, T.; Tarassenko, L.; Clifton, D.A.; Beale, R.; Watkinson, P.J. An assessment of algorithms to estimate respiratory rate from the electrocardiogram and photoplethysmogram. Physiol. Meas. 2016, 37, 610–626. [Google Scholar] [CrossRef] [Scilit]
  20. Al-Halhouli, A.; Al-Ghussain, L.; Bouri, S.; Liu, H.; Zheng, D. Clinical evaluation of stretchable and wearable inkjet-printed strain gauge sensor for respiratory rate monitoring at different measurements locations. J. Clin. Monit. Comput. 2021, 35, 453–462. [Google Scholar] [CrossRef] [Scilit]
  21. Pimentel, M.A.F.; Charlton, P.H.; Clifton, D.A. Probabilistic Estimation of Respiratory Rate from Wearable Sensors. In Wearable Electronics Sensors: For Safe and Healthy Living; Mukhopadhyay, S.C., Ed.; Springer International Publishing: Cham, Switzerland, 2015; pp. 241–262. [Google Scholar] [CrossRef] [Scilit]
  22. Kim, J.S.; Kim, J. An accurate respiratory rate estimation algorithm for a rubber fiber respiratory sensor. J. Ind. Text. 2024, 54, 15280837241248181. [Google Scholar] [CrossRef] [Scilit]
  23. Bhongade, A.; Prathosh, A.P.; Gandhi, T. RespTrack-Net: Respiration Parameters Tracking From PPG Signal Using Deep Learning Model. IEEE Sens. Lett. 2025, 9, 5500604. [Google Scholar] [CrossRef] [Scilit]
  24. Bian, D.; Mehta, P.; Selvaraj, N. Respiratory Rate Estimation using PPG: A Deep Learning Approach. In Proceedings of the Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Montreal, QC, Canada, 20–24 July 2020; pp. 5948–5952. [Google Scholar] [CrossRef] [Scilit]
  25. Osathitporn, P.; Sawadwuthikul, G.; Thuwajit, P.; Ueafuea, K.; Mateepithaktham, T.; Kunaseth, N.; Choksatchawathi, T.; Punyabukkana, P.; Mignot, E.; Wilaiprasitporn, T. RRWaveNet: A Compact End-to-End Multiscale Residual CNN for Robust PPG Respiratory Rate Estimation. IEEE Internet Things J. 2023, 10, 15943–15952. [Google Scholar] [CrossRef] [Scilit]
  26. Chin, W.J.; Kwan, B.H.; Lim, W.Y.; Tee, Y.K.; Darmaraju, S.; Liu, H.; Goh, C.H. A Novel Respiratory Rate Estimation Algorithm from Photoplethysmogram Using Deep Learning Model. Diagnostics 2024, 14, 284. [Google Scholar] [CrossRef] [Scilit]
  27. Sabry, F.; Eltaras, T.; Labda, W.; Alzoubi, K.; Malluhi, Q. Machine Learning for Healthcare Wearable Devices: The Big Picture. J. Healthc. Eng. 2022, 2022, 4653923. [Google Scholar] [CrossRef] [Scilit]
  28. Ray, P.P. A review on TinyML: State-of-the-art and prospects. J. King Saud Univ.-Comput. Inf. Sci. 2022, 34, 1595–1623. [Google Scholar] [CrossRef] [Scilit]
  29. David, R.; Duke, J.; Jain, A.; Reddi, V.J.; Jeffries, N.; Li, J.; Kreeger, N.; Nappier, I.; Natraj, M.; Regev, S.; et al. TensorFlow Lite Micro: Embedded Machine Learning on TinyML Systems. arXiv 2021, arXiv:2010.08678. [Google Scholar]
  30. Anbukarasu, P.; Nanisetty, S.; Tata, G.; Ray, N. Tiny-HR: Towards an interpretable machine learning pipeline for heart rate estimation on edge devices. arXiv 2022, arXiv:2208.07981. [Google Scholar] [CrossRef] [Scilit]
  31. Kim, E.; Kim, J.; Park, J.; Ko, H.; Kyung, Y. TinyML-Based Classification in an ECG Monitoring Embedded System. Comput. Mater. Contin. 2023, 75, 1751–1764. [Google Scholar] [CrossRef] [Scilit]
  32. Ooko, S.O.; Nsenga, J. Tiny Machine Learning (TinyML) Based Self Diagnostic Kit for Respiratory Diseases. In Proceedings of the 2023 International Conference on Computer and Applications (ICCA), Cairo, Egypt, 28–30 November 2023; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  33. Abadade, Y.; Benamar, N.; Bagaa, M.; Chaoui, H. Empowering Healthcare: TinyML for Precise Lung Disease Classification. Future Internet 2024, 16, 391. [Google Scholar] [CrossRef] [Scilit]
  34. Scherf, M.; Kulha, P.; Kokkinis, G.; Heer, R.; Stark, P. Breath Rate Sensor AM Integration Concept for E-textiles. In Proceedings of the 2023 IEEE SENSORS, Vienna, Austria, 29 October–1 November 2023; pp. 1–4. [Google Scholar] [CrossRef] [Scilit]
  35. Scherf, J.M.; Kulha, P.; Stark, P.; Berger, L.; Kokkinis, G.; Prabhu, A. Wearable Health Monitoring Textile Band with Direct Inkjet-Printed Electronic Island. In Proceedings of the 2024 International Conference on the Challenges, Opportunities, Innovations and Applications in Electronic Textiles (E-Textiles), Berlin, Germany, 19–21 November 2024; pp. 211–215. [Google Scholar] [CrossRef] [Scilit]
  36. Kokkinis, G.; Ibrahim, K.; Scherf, M.; Kulha, P.; Heer, R. A real-time readout system enabling vital function monitoring with textile-integrated sensors. Elektrotechnik Informationstechnik 2025, 142, 388–395. [Google Scholar] [CrossRef] [Scilit]
  37. Carvalho, F.; Tiago, M.; Portugal, D.; Tavakoli, M. WoW—Wearable Respiration Monitoring Dataset; Mendeley Data: London, UK, 2022. [Google Scholar] [CrossRef]
  38. Pimentel, M.A.F.; Johnson, A.E.W.; Charlton, P.H.; Birrenkott, D.; Watkinson, P.J.; Tarassenko, L.; Clifton, D.A. Toward a Robust Estimation of Respiratory Rate From Pulse Oximeters. IEEE Trans. Biomed. Eng. 2017, 64, 1914–1923. [Google Scholar] [CrossRef] [Scilit]
  39. Saeed, M.; Villarroel, M.; Reisner, A.; Clifford, G.; Lehman, L.-w.; Moody, G.; Heldt, T.; Kyaw, T.; Moody, B.; Mark, R. MIMIC-II Clinical Database, Version 2.6.0; PhysioNet: Cambridge, MA, USA, 2011. [CrossRef]
  40. Karlen, W. CapnoBase InVivo Dataset, 2021. Available online: https://borealisdata.ca/dataset.xhtml?persistentId=doi:10.5683/SP2/7JTWDZ (accessed on 5 April 2026).
  41. Hymel, S.; Banbury, C.; Situnayake, D.; Elium, A.; Ward, C.; Kelcey, M.; Baaijens, M.; Majchrzycki, M.; Plunkett, J.; Tischler, D.; et al. Edge Impulse: An MLOps Platform for Tiny Machine Learning. arXiv 2023, arXiv:2212.03332. [Google Scholar] [CrossRef] [Scilit]
  42. Gupta, K.; Yeduri, S.R.; Cenkeramaddi, L.R. Breathing Rate Classification Using Piezoresistive Sensor Utilizing Continuous Wavelet Transform and Lightweight CNN. IEEE Access 2024, 12, 50362–50375. [Google Scholar] [CrossRef] [Scilit]
  43. Jeong, I.; Chung, W.G.; Kim, E.; Park, W.; Song, H.; Lee, J.; Oh, M.; Kim, E.; Paek, J.; Lee, T.; et al. Machine learning in biosignal analysis from wearable devices. Mater. Horiz. 2025, 12, 6587–6621. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.