Abstract
Background
A person's breathing pattern can be a reflection of their emotional and physical well-being because it shows the frequency, intensity, and rhythm of their breathing.
Objective
This research article presents a comprehensive approach to breathe pattern classification utilizing gyroscope and accelerometer readings obtained from individuals using two distinct sensors. The study encompasses the acquisition of six diverse breathing patterns, with a focus on data pre-processing through Min-Max normalization.
Methods
To select essential features from the normalized data, an innovative optimization algorithm, Adaptive Chimp Optimization (AdCO), is introduced. AdCO integrates an adaptive weighting strategy into the conventional Chimp optimization algorithm, enhancing convergence rates and enabling global optimal feature selection. Furthermore, the article introduces the application of the selected features in breath pattern classification using a hybrid deep learning mechanism, DABiG. DABiG leverages the Bidirectional Gated Recurrent Unit (BiGRU), a neural network architecture capable of processing sequential data bi-directionally.
Results
Spatial and temporal attention mechanisms are incorporated into DABiG to enhance its ability to focus on relevant spatial regions and time steps within the breath pattern data.
Conclusion
Spatial attention assigns weights to spatial regions, while temporal attention assigns weights to time steps, improving feature extraction and classification accuracy.
Keywords
Introduction
Breathing is one of the most essential physiological functions for all living things. An irregular breathing pattern may be the first sign that anything is amiss in any psychological, physiological, or mechanical problem. 1 Therefore, respiration needs to be considered in all physical therapy evaluations. Breathing techniques have changed dramatically with the ages, philosophies, and civilisations. Since the turn of the century, Western medicine has acknowledged the significance of breathing for health, and more recent research has carefully reviewed the role of the breath in both wellness and illness.2,3 In favour of the general role that physical therapy may play in improving breathing patterns through symptom reduction or elimination and wellbeing promotion. 4 Thus far, there hasn't been much discussion of aberrant breathing patterns or breathing re-education in the physiotherapy literature. 5
A population of Army Basic Combat Training (BCT) troops showed an increased prevalence of febrile Airway, Respiratory Rate, and Inspiratory Effort (ARI) when living in newer, more energy-efficient buildings. 6 Other studies have generally looked at the interior settings of office buildings, with varied degrees of effectiveness. According to recent studies, the environment has a critical role in the spread of respiratory illnesses within a community of military trainees and social isolation. 7 While only a tiny fraction of ARIs in the US progress to significant consequences, the majority cause acute morbidity, which results in missed workdays. The typical classifications for ARIs include upper and lower respiratory infections. 8 Most upper respiratory infections are caused by viruses that resemble mild illnesses. Particularly in elderly adults, immunocompromised individuals, and young children in developing nations, lower respiratory infections such as pneumonia can have far more serious outcomes. 9 According to the World Health Organisation, lower respiratory infections rank third among all causes of death globally each year, accounting for 4.18 million deaths or 7.1% of all fatalities. Young children, the elderly, and people with compromised immune systems are more likely to contract these illnesses in developing nations. Respiratory infections account for 25–30% of infectious disease hospitalisations in U.S. military populations and are the primary source of illness that does not require hospitalisation. 10
Using data on chest displacement, several tests have been conducted to precisely calculate the respiration rate. Patients with respiratory diseases cannot be used to represent abnormal breathing patterns using respiration rate. 11 Machine learning tools that recognise breathing patterns are essential for diagnosing respiratory issues. The incorporation of machine learning will be extremely beneficial for automating a more sophisticated and intelligent system. Thus, efforts were made to integrate artificial intelligence with radar imaging to develop a system that can recognise and classify patterns of breathing abnormalities. 12 Mel-Frequency Cepstral Coefficients (MFCC) feature extraction, XGBoost classifier, and FMCW radar are used to recognise non-contact breathing patterns in an interior setting. Furthermore, XGBoost recognises, reduces, and captures large amounts of breathing with the help of MFCC extraction of features. 13
This study thus introduces a deep learning framework for the categorisation of breathing patterns. The optimal feature selection method is used in the suggested AdCO + DABiG-based breath pattern classification to select the best features and increase the breath pattern's classification accuracy. Furthermore, the BiGRU's inclusion of a dual attention mechanism helps to capture temporal and spatial characteristics as well as long-term dependent features without experiencing vanishing gradient problems. The major contributions of the research are:
AdCO Algorithm for Feature Selection: To choose the optimal best features using the Adaptive Chimp optimization (AdCO) algorithm, wherein the adaptive weighting strategy is incorporated into the conventional Chimp optimization algorithm for enhancing the convergence rate in choosing the optimal best solution. Proposed DABiG for breath pattern Classification: To classify the breath patterns using the hybrid deep learning technique named DenseGRU is designed by hybridizing the DenseNet-121 and Gated Recurrent Unit (GRU) for enhancing the classification accuracy.
The organization of the research is: The existing breath pattern analysis methods along with the problem statement is presented in Section 2 and the proposed methodology is detailed in Section 3. Finally, Section 4 presents the experimental outcome and Section 5 concludes the research.
Related works
Some of the existing breath pattern analysis approaches are reviewed here. Respiration Variability Spectrogram (RVS) Sequences-based pattern analysis was introduced by 14 for recognizing psychological stress levels through breathing patterns. The developed model strengths encompassed automated feature extraction, enabling robust learning from limited data, and an innate ability to capture the nuanced dynamics of breathing using the deep learning model.Here, the inclusion of an augmentation strategy effectively expanded the model's ability to learn from limited datasets that promoted better generalization to a diverse spectrum of breathing patterns. The signal transformation enabled the model to encapsulate the intricate and dynamic nature of breathing patterns more comprehensively. A machine learning-based breath pattern analysis was designed by 15 using the Respiratory Rate, Temperature, and Heart Rate. The primary objective was to predict the onset of moderate-to-severe respiratory failure using readily accessible vital signs. Here, the adoption of a random forest approach for modeling offered robustness and the ability to capture complex relationships within the data. While the introduced method offered advantages such as a holistic understanding of the medical problem and the use of readily accessible data, it also came with challenges related to data quality, feature selection, and the balance between prediction accuracy and timeliness.
The introduction of an innovative wearable system based on Arduino technology was designed by 16 for breath pattern monitoring, particularly for sleep apnea diagnosis and continuous surveillance, held significant promise. The system autonomously identifies and categorizes various respiratory patterns like instances of breathlessness, encompassing exhalation and inhalation. Arduino's flexibility and adaptability in capturing patient information made it a suitable choice for this specialized medical application. Still, the computational power and data processing capabilities have impacted the system's overall performance. XGBoost-based respiratory was implemented by 17 for respiratory disorder detection byclassifying breathing patterns. In this, the Mel-frequency cepstral coefficient (MFCC) for extracting relevant features from the breathing signal. The potential applications in respiratory disorder detection held promise, but they also entailed challenges related to computational resources and real-world implementation.
Motivation
Using image processing techniques based on artificial intelligence and machine learning, breathing disorder diagnosis devices have been created in response to current advances in wearable sensors and devices for monitoring respiration. To recognize the condition using ECG readings, for instance, deep learning algorithms have been applied. Medical practitioners have been able to establish criteria for sleep apnea diagnosis by the real-time estimate of visual equipment patterns from images of a patient's stomach and chest. However, present devices have high pricing, difficult detecting procedures, poor accuracy, and difficulty with usage. As a result, it is critical to fulfill the demand for low-cost, automated devices that can deliver simple, measurements in real time while guaranteeing high rates of specificity, sensitivity, and accuracy.Thus, a deep learning-based military breathing pattern analysis is introduced to enhance the classification accuracy with minimal computation complexity.
Proposed methodology
The primary objective of military breathing pattern analysis is to gather information about a soldier's respiratory behavior to ensure their health, performance, and readiness. Monitoring and analyzing breathing patterns in the military is crucial for several reasons, including evaluating the physical and psychological well-being of soldiers, identifying signs of stress or respiratory distress, and optimizing performance in high-stress situations. Thus, the military pattern analysis is introduced in this research for enhancing the classification accuracy with minimal computation complexity. Initially, the breath patterns are gathered from individuals using the wearable sensors. Then, the data normalization is devised to make the data in standard form to make the computations simpler. Then, the optimal best features are acquired using the proposed adaptive Chimp optimization (AdCO) algorithm, which is designed by incorporating the adaptive weighting strategy within the conventional Chimp optimization algorithm for choosing the most informative features that enhance the classification accuracy. Finally, the breathing patterns are classified using the hybrid deep learning method named Dual attention Bidirectional Gated Recurrent Unit (DABiG). Here, the dual attention mechanism is integrated into the conventional BiGRU to enhance classification accuracy. The workflow diagram is presented in Figure 1.

Workflow of AdCO + DABiG-based breath pattern classification.
The data is gathered using the gyroscope and accelerometer readings are acquired from the individuals using two various sensors. Six various breathing patterns are collected from the individuals and are utilized for the classification task. 18 The six various breath patterns areNormal breathing, Apnea, coughing, Muller, Sighing, and Yawning. These breath patterns were captured based on the physician's instruction for 5 min and 5 repetitions.
Data normalization
Data standardization is essential for making the computations simpler, which is accomplished through the data normalization technique. Min-Max normalization is utilized for performing the data normalization and is stated as:
For the selection of optimal best features from the normalized data, the proposed Adaptive Chimp Optimization (AdCO) is utilized. The AdCO is designed by integrating the adaptive weighting strategy within the conventional Chimp optimization algorithm for enhancing the convergence rate. The chimp is one among the Great apes like chimpanzees, bonobos, gorillas, and orangutans that are native to Africa. Brain-to-Body Ratio (BBR) level is higher for chimpanzees and dolphins; still, BBR is relatively high for chimpanzees. BBR is a measure of brain size relative to body size. The mammal with a higher level of BBR has smart behavior; hence, Chimp is considered for solving the optimization issue by considering its hunting behavior. Still, the Chimp optimization algorithm has the challenge of local optimal trapping, which is solved by incorporating the adaptive weighting strategy with the conventional algorithm. Hence, the proposed AdCO algorithm assistsin providing the global best optimal solution in choosing the essential features that enhance the classification accuracy. Besides, the balanced exploration and exploitation rate of the algorithm efficiently solves the optimization issue.
Mathematical modeling
While designing the optimization algorithm, four various categories of chimps are considered: attacker, chaser, barrier, and driver.
Attacker: Attackers are skilled in predicting the prey's potential escape routes and take actions to block or influence those routes. Attackers use their ability to anticipate the prey's movements and strategically position themselves to cut off escape paths. Thus, the escaping probability of the target gets reduced and the capturing is made simpler.
Barrier: Barriers position themselves in a tree to create an obstruction or barrier that blocks the path of the prey by creating a physical obstacle.
Chaser: The Chaser is a chimp that interacts with a target and the one who follows or observes the target to capture it.
Driver: The Driver is a role responsible for coordinating and guiding the optimization process. It plays a role similar to a leader or a coordinator within the chimp group. Drivers might be responsible for selecting the best solutions or directing the search towards promising areas of the search space.
Initialization: The population of the chimps (search agents) and the maximal number of iterations are initialized.
Fitness Estimation: Estimating fitness allows algorithms to operate more efficiently by avoiding unnecessary evaluations and speeding up the convergence of optimization. It is estimated as:
Target Chasing: the target is captured in both the exploitation and exploration phases using various attacking strategies. The chasing and driving behavior of the search agent is mathematically designed as:
Exploitation Phase: While exploring the search space, except for the attacker search agent all the remaining three types of search agents participate in capturing the target. In contrast, the attacker search agent participates in attacking the target, which is surrounded by the chaser, driver, and barrier. The solution accomplished by the search agents in this phase is designed as:
Chaotic-based solution updation: Chaotic behavior refers to behavior that appears random and unpredictable but follows deterministic rules. Thus, the chaotic behavior injects randomness, which can expedite convergence by guiding the search toward promising areas of the high-dimensional space. The formulation for the chaotic behavior-based solution updation is expressed as:
Re-evaluation of fitness: The fitness is re-evaluated to check the feasibility of the solution obtained by the algorithm.
Termination: The acquisition of a better solution for choosing the optimal best features or the attainment of maximal iteration stops the termination of the algorithm.
Using the selected features, the breath pattern classification is devised using the hybrid deep learning mechanism. The BiGRU is a type of recurrent neural network (RNN) that processes sequential data bi-directionally. It consists of two GRU layers, one processing the data in the forward direction and the other in the backward direction. GRU stands for Gated Recurrent Unit, which is a variant of the more traditional long short-term memory (LSTM) cell. GRUs are known for their ability to capture long-range dependencies in sequential data while being computationally efficient. Each GRU cell maintains a hidden state that encodes information from previous time steps and uses this information to update its current state. Besides, spatial attention focuses on the information from different spatial locations (e.g., sensors on the chest, abdomen, and back) where data is collected. The spatial attention mechanism computes attention weights for each spatial location, indicating which sensors are most relevant for the classification task. These weights are often learned during training. The spatial attention weights are used to combine the spatial information into a single, weighted representation. Temporal attention is applied to the sequential data to capture the dynamic nature of breathing patterns over time. For each time step, the temporal attention mechanism computes a weight or attention score, indicating the importance of that time step's information relative to the others in the sequence. The temporal attention weights create a weighted representation of the sequence, emphasizing the most relevant time steps for classification. The architecture of the DABiG for breath pattern analysis is depicted in Figure 2.

Architecture of the DABiG for breath pattern analysis.
Initially, the candidate state
Temporal Attention Module: A temporal attention mechanism assigns weights to each time step within a breath pattern sequence. These weights represent the relative importance of each part of the sequence in making the final classification decision. After calculating the attention weights, the model computes a weighted sum of the input sequence, where each time step is multiplied by its corresponding attention weight. This weighted sum effectively highlights the most relevant characteristics of the breath pattern sequence. It is expressed as:
Spatial Attention Module: Spatial attention mechanisms assign importance weights to different spatial features within the input data. These weights represent the relative significance of each feature for the classification task. Features with higher weights are considered more important in making the final classification decision. After computing the attention weights, the model typically performs a weighted sum or a weighted aggregation of the input data based on these weights. This aggregation process highlights the most relevant spatial features for the breath pattern classification. It is expressed as:
Softmax Classification: Finally, the softmax classification is devised for classifying the five various breath patterns.
The implementation is employed in the PYTHON programming language and the assessment is made based on various assessment measures like accuracy, precision, recall, specificity, and F-score. In this, the conventional breath pattern analysis methods like those Proposed without FS, 1D-CNN, 18 Deep Breath, 16 and Ensemble learning 17 are evaluated to depict the superiority of the proposed method. For the analysis, the maximal iteration of 100, the population size of 50, epochs of 100, and softmax activation are considered, which is chosen based on a trial and error approach.
Analysis by varying training data
The analysis by varying the training percentage is presented in Figure 3 for various assessment measures and the detailed analysis is depicted in Table 1. Let the accuracy evaluated by the AdCO + DABiG is 96.05% with 80% of training data, which is 95.94% using the DABiG (Proposed without AdCO-based feature selection). Thus, the role of feature selection is crucial in the proposed breath pattern classification model.

Analysis by varying training data: (a) accuracy, (b) F-Score, (c) precision, (d) recall and (e) specificity.
Analysis by varying training data.
The AdCO algorithm significantly contributed by enhancing the feature selection process, ensuring the selection of globally optimal features for breath pattern classification. By dynamically adjusting the weights assigned to different features, AdCO improved convergence rates and optimized the feature subset, resulting in improved classification performance. Furthermore, the DABiG model, which incorporates a BiGRU along with spatial and temporal attention mechanisms, effectively captured the complex patterns within the breath data, leading to enhanced classification accuracy. The combination of AdCO and DABiG allowed for the extraction of informative features and the robust classification of breath patterns, resulting in high performance.
The analysis by varying the K-Fold is presented in Figure 4 for various assessment measures and the detailed analysis is depicted in Table 2. In this, by dividing the dataset into k subsets, the model is trained and tested k times, with each subset used once as a testing set and the remaining k-1 subsets used for training. This process ensures that the model's performance is accurately assessed across different subsets of the data, reducing the risk of overfitting and providing more reliable performance metrics. Let the precision evaluated by the AdCO + DABiG is 97.37% with K-Fold value 10, which is 1.46%, 6.53%, 6.24%, and 7.71% superior compared to Proposed without FS, 1D-CNN, Deep Breath, and Ensemble learning methods.

Analysis by varying K-Fold: (a) accuracy, (b) F-Score, (c) precision, (d) recall and (e) specificity.
Analysis by varying K-Fold.
Here, the analysis indicates the superiority of the proposed method using the novel feature selection and hybrid classifier.
The convergence analysis of the AdCO algorithm and the existing chimp optimization algorithm is portrayed in Figure 5.In this case, the inclusion of an adaptive weighting strategy in traditional chimpanzee optimization assists AdCO in enhancing the convergence rate more rapidly. In addition, the consideration of accuracy, sensitivity, and specificity as the fitness for choosing the optimal best features, assist in enhancing the classification accuracy of the proposed model.

Convergence Analysis.
The ablation study of the proposed breath classification method is presented in Table 3, wherein the accuracy analysis is detailed.The analysis indicates the superiority of the proposed method with optimal feature selection and the hybrid deep learning model for breath pattern classification.
Ablation study in terms of accuracy.
Ablation study in terms of accuracy.
The comparative analysis of the proposed breath classification method and the existing methods is portrayed in Table 4.
Comparative analysis.
Comparative analysis.
The proposed method acquired superior outcomes in terms of all assessment measures. The utilization of an adaptive weighting strategy in the Chimp Optimization (AdCO) for feature selection, coupled with spatial, temporal, and BiGRU-based breath pattern classification, offers several significant benefits. Initially, the adaptive weighting strategy enhances the traditional Chimpanzee Optimization algorithm by dynamically adjusting the weights assigned to different features during the optimization process. This adaptability allows for a more efficient and effective feature selection process, as it ensures that the most relevant features are given higher importance, leading to improved classification accuracy and model performance. Then, the incorporation of spatial, temporal, and BiGRU-based breath pattern classification techniques further enhances the accuracy and robustness of the classification model. By considering the spatial and temporal dependencies within the breath pattern data, the classification model becomes more adept at capturing complex patterns and variations in the data, thereby improving its ability to accurately classify different breath patterns. Hence, the combination of AdCO for feature selection and spatial, temporal, and BiGRU-based breath pattern classification offers a powerful and effective approach for analyzing and classifying breath patterns.
In this research, we have presented a holistic approach to breathing pattern classification by leveraging gyroscope and accelerometer data from individuals. The study begins with data acquisition from two different sensors and includes the collection of six diverse breathing patterns for analysis. Data pre-processing through Min-Max normalization ensures that computations are conducted efficiently. Feature selection is a critical step, and the AdCO algorithm is introduced, a novel optimization technique inspired by the hunting behavior of chimpanzees. AdCO enhances convergence rates and enables the selection of globally optimal features for breath pattern classification. To carry out breath pattern classification, the DABiG is introduced, which incorporates a BiGRU and spatial attention along with temporal attention mechanisms. The performance of the proposed AdCO + DABiG based on Accuracy, Precision, Recall, F-Score, and Specificity evaluated is 97.46%, 97.37%, 98.52%, 96.62%, and 97.62% respectively.
While the proposed approach for breath pattern classification utilizing gyroscope and accelerometer data presents promising results, some several limitations and challenges need to be addressed. Firstly, the effectiveness of the model heavily relies on the quality and quantity of the input data. While the study collects data from two different sensors and includes six diverse breathing patterns for analysis, the variability and representativeness of the data may still be limited. Moreover, while the DABiG model, incorporating BiGRU and spatial and temporal attention mechanisms, shows high accuracy in breath pattern classification, its computational complexity may limit its scalability to large datasets. Therefore, future research should focus on addressing these limitations by collecting more diverse and representative data, optimizing the AdCO algorithm and DABiG model for improved scalability and efficiency, and exploring additional evaluation metrics to assess the model's performance comprehensively. Additionally, the integration of real-time monitoring capabilities and the development of user-friendly interfaces could enhance the practicality and usability of the proposed model for various healthcare applications, such as respiratory disease diagnosis and monitoring.
Footnotes
Ethics approval statement
Not Applicable.
Patient consent statement
Not Applicable.
Permission to reproduce material from other sources
Not Applicable.
Clinical Trial registration
Not Applicable.
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Data availability
Data will be made available upon reasonable request.
