Submitted:
01 September 2026
Posted:
02 September 2026
You are already at the latest version
Abstract
Automatic characterization of adventitious respiratory sounds is essential for developing computer aided systems that support respiratory disease diagnosis. Commonly used acoustic descriptors, such as Mel frequency cepstral coefficients (MFCCs), primarily characterize spectral information and may not fully capture the nonlinear temporal dynamics of respiratory signals. In this work, we investigate the discriminative capability of Generalized Weighted Ordinal Pattern (GWOP) descriptors for representing adventitious respiratory sounds. Using respiratory recordings from the publicly available SPRSound pediatric database, GWOP descriptors were computed over multiple embedding dimensions, weighting factors, and time delays. An XGBoost classifier was employed exclusively as a supervised validation model to assess the discriminative information contained in the proposed feature representation, while the XGBoost Gain criterion was used to analyze the contribution of individual descriptor components. The proposed representation achieved stable performance across cross validation folds, outperformed a conventional MFCC representation under the same evaluation protocol, and demonstrated that a reduced subset of Gain selected features preserved, and slightly improved, the classification performance while substantially reducing the dimensionality of the original feature space. These findings indicate that GWOP provides a lighter yet more informative and interpretable representation of adventitious respiratory sounds, capturing nonlinear ordinal dynamics that complement conventional spectral descriptors and offering a promising alternative for respiratory sound characterization.
Keywords:
ordinal patterns
; permutation entropy
; generalized weighted ordinal patterns
; respiratory sound analysis
; adventitious respiratory sounds
1. Introduction
Respiratory diseases represent a major global health challenge, accounting for a substantial proportion of morbidity and mortality worldwide. According to worldwide studies, respiratory disorders remain among the leading causes of disability and premature death, generating a considerable socioeconomic impact on healthcare systems [1,2]. Therefore, early detection and accurate assessment of respiratory conditions are essential for timely diagnosis, disease monitoring, and treatment planning. Among the available diagnostic techniques, pulmonary auscultation remains one of the most accessible and widely used non-invasive methods because it provides valuable information about airflow and pathological alterations within the respiratory system. During auscultation, clinicians analyze normal and adventitious respiratory sounds, such as wheezes, crackles, rhonchi, and stridor, whose occurrence is associated with several respiratory disorders, including asthma, chronic obstructive pulmonary disease (COPD), pneumonia, and interstitial lung diseases [3,4,5].
Despite its clinical importance, conventional pulmonary auscultation is highly dependent on the clinician’s expertise and auditory perception, which may lead to subjectivity and inter-observer variability. Furthermore, respiratory sounds are inherently non-stationary signals whose characteristics vary according to multiple factors, including patient condition, anatomical recording location, respiratory phase, and acquisition device. The coexistence of multiple adventitious events within the same respiratory cycle, together with environmental and physiological noise, further increases the difficulty of their interpretation. These limitations have motivated the development of computer-aided respiratory sound analysis systems capable of providing objective, reproducible, and quantitative assessments to support clinical decision making [4,6].
Automatic respiratory sound analysis has received increasing attention during the last decade. Existing computational approaches can be broadly categorized into handcrafted acoustic descriptors, time frequency representations, and deep learning based methods. Traditional features, including Mel-frequency cepstral coefficients (MFCCs), spectral descriptors, and wavelet-based representations, have been extensively investigated because of their computational efficiency and relatively straightforward interpretation. In parallel, the availability of annotated respiratory sound databases, such as the International Conference on Biomedical and Health Informatics (ICBHI) respiratory sound database and the SPRSound dataset, has enabled the development of increasingly sophisticated machine learning and deep learning approaches [7,8]. Convolutional neural networks and other deep architectures have demonstrated competitive performance by automatically learning discriminative representations from respiratory recordings [9,10]. However, these approaches generally require large amounts of labeled data, considerable computational resources, and often provide limited interpretability regarding the relationship between learned features and physiological mechanisms.
Respiratory sounds are generated through complex interactions between airflow turbulence, airway geometry, tissue mechanics, and pathological alterations in the respiratory system [3,11]. As a result, they exhibit rich temporal dynamics that cannot be fully characterized by conventional linear or spectral descriptors alone, which motivates researching the applicability of nonlinear time-series analysis in this context. Early evidence came from fractal analysis, where Oliveira et al. [12] showed that normal lung sounds exhibited a nearly constant time-dependent fractal dimension (), whereas recordings containing adventitious sounds displayed pronounced temporal variations and multiple local fractal dimensions. This finding suggested that pathological conditions alter the underlying dynamics rather than only their spectral content. Building on these findings, Gnitecki and Moussavi [13] demonstrated that inspiratory lung sounds exhibit self-affine behavior, a hallmark of fractal time series, meaning that their statistical structure is preserved across temporal scales. A stronger justification for nonlinear analysis was later provided in [14], where the authors explicitly investigated whether respiratory sounds satisfy the assumptions required for nonlinear dynamical analysis. Using recurrence plots, surrogate-data testing, and chaotic invariants, they demonstrated that respiratory sounds exhibit dynamical properties consistent with deterministic chaos, providing a strong rationale for nonlinear time-series analysis. This evidence has established nonlinear time-series analysis as a suitable framework for respiratory sound characterization, enabling the quantification of complexity and temporal organization beyond conventional frequency-domain analysis.
Among complexity measures, Permutation Entropy (PE), introduced by Bandt and Pompe [15], has become one of the most widely used approaches for analyzing biomedical signals due to its simplicity, computational efficiency, robustness to noise, and invariance to monotonic transformations [16,17]. Unlike conventional spectral measures, PE does not rely on signal amplitude values. Instead, it characterizes the probability distribution of ordinal patterns generated from the temporal ordering of neighboring samples. This property has enabled its successful application in several biomedical domains, including electroencephalography, electrocardiography, heart rate variability, and eye-tracking signals, where complexity assessment provides relevant information indistinguishable by other analysis techniques [17,18,19,20]. Entropy-based descriptors have also shown promise in the specific context of respiratory sound analysis. For instance, multiscale permutation entropy has been reported to improve lung sound classification accuracy over other entropy variants [21], and Shannon, logarithmic, and spectral entropy features have been combined with ensemble classifiers for multi-class identification of respiratory diseases from stethoscopic recordings [22].
Since ordinal patterns are determined exclusively by the relative values of consecutive samples, the encoding process is oblivious to the actual amplitudes.
2. Materials and Methods
Figure 1 summarizes the proposed methodological framework for respiratory sound analysis. The workflow begins with the acquisition of respiratory audio recordings, which are segmented using a windowing strategy to generate individual analysis frames. Subsequently, the Generalized Weighted Ordinal Pattern (GWOP) method is applied to extract nonlinear temporal features from each respiratory sound segment, resulting in a high-dimensional feature representation composed of 15,750 descriptors. The extracted feature vectors are then divided into training and testing subsets to evaluate the classification performance. Hyperparameter optimization is performed using a randomized search strategy combined with 5-fold cross-validation to identify the optimal configuration of the classifier. Finally, the optimized XGBoost model is trained and evaluated using the independent test set, and its performance is assessed through standard classification metrics.
2.1. Respiratory Sound Database
This study made use of the SPRSound database (Open-Source SJTU Pediatric Respiratory Sound Database) [8], the first publicly available open-access respiratory sound database recorded exclusively in the pediatric population, comprising patients aged between 1 month and 18 years. Recordings were obtained at the Pediatric Respiratory Department of Shanghai Children’s Medical Center (SCMC, Shanghai, China) using Yunting Model II stethoscopes and stored in .wav format with a sampling frequency of 8 kHz. The database provides annotations at two complementary levels. At the record level, each recording is labeled as Normal (N), Continuous Adventitious Sounds (CAS), Discontinuous Adventitious Sounds (DAS), CAS & DAS, or Poor Quality. At the event level, individual respiratory events are annotated with their temporal boundaries (onset and offset in milliseconds) and classified as Normal (N), Rhonchi (R), Wheeze (W), Stridor (S), Coarse Crackle (CC), Fine Crackle (FC), or Wheeze & Crackle (WC). For the present analysis, the training partition of the 2022 to 2025 release was used, comprising 6641 recordings. Recordings flagged as Poor Quality at the record level were excluded from the analysis. From the remaining files, a sliding-window approach was applied to extract overlapping segments of 1 second at the native sampling rate of each recording. Segments were assigned to one of seven classes according to the event-level annotation whose temporal span fully covered the segment. Representative waveforms of each class are shown in Figure 2.
2.2. Nonlinear Feature Extraction
To quantify the underlying dynamics of respiratory sounds, we employed an extension of the symbolic representation of time series through ordinal patterns (OP), introduced by Bandt & Pompe [15]. In this representation, time series are encoded into symbols that capture the rank-order relationships among consecutive signal samples, providing a robust and compact description [23]. The diversity and uniformity of the relative frequencies of these OPs along a time series can be effectively used to characterize its regularity (or lack thereof), typically distinguishing periodic dynamics from chaotic or stochastic behavior. Given a time series , the OPs are constructed by extracting overlapping segments :
where the embedding dimension D determines how many samples are included in each segment, and the time delay specifies the temporal spacing between them. A total of segments are extracted from the original series X. Within each segment, the D values are assigned ordinal labels according to their rank-order relationships. Conflicts arising in case of identical sample values (unlikely but possible in biological signals) can be resolved either by deterministic or random schemata, with no actual effect in the analysis results. In total, there exist possible permutations to which a segment of the signal can be mapped. Figure 3 presents examples of OPs for , illustrating also the effect of varying the delay parameter . The relative frequency (empirical probability) of each as:
where denotes the OP corresponding to segment s. For a robust empirical probability evaluation, it is recommended that . The probability distribution over all possible patterns is then defined as .
However, using only rank-order information makes the method oblivious to relative amplitudes, which can be disadvantageous in several contexts. For this reason, Weighted Permutation Entropy (WPE) proposes to assign higher contribution to patterns with larger amplitude ranges, thus preserving information related to signal variability while maintaining the advantages of ordinal analysis [24]. More recently, Generalized Weighted Permutation Entropy (GWPE) extended this concept by introducing an entropic index that improves the characterization of complex nonlinear signals [25]. This entropic index q plays a role analogous to the q-parameter of non-extensive entropies (Tsallis and Renyi), extending the classical entropy analysis toward a generalized framework that can distinguish apart different fluctuation regimes. The generalized weighted ordinal pattern (GWOP) probability distribution , is thus defined as
where
and is the mean of segment . Segments with zero range (locally constant signal) yield for . In such cases the weight is set to zero to avoid numerical indeterminacy [25]. The parameter controls the sensitivity of the weighting to the scale of the fluctuations: for , the importance of higher range OPs is amplified, and conversely for low range OPs are emphasized. It is worth noting that for GWOP collapses into the Bandt & Pompe OP distribution.
2.3. Feature Extraction
Since GWOP descriptors are computed from short temporal windows, the original recordings from the SPRSound dataset (2022–2025) were partitioned into fixed-length segments using a sliding-window approach. The use of one-second windows limits the temporal variability within each segment, providing a more reliable estimation of the corresponding ordinal pattern distributions while preserving the local dynamics of the respiratory signal. Each audio file was divided into one-second segments with a 50% overlap (500 ms hop size), yielding two windows per second of recording. Windows were labeled according to the event annotations provided in the dataset’s JSON files, with each window assigned the label of the annotation exhibiting the greatest temporal overlap. Windows with no overlapping annotated event were labeled as Normal. Audio files shorter than one second were zero-padded to ensure a uniform segment length prior to GWOP feature extraction.
This procedure produced 17,682 one-second segments distributed across seven classes. To mitigate class imbalance without introducing synthetic samples, an adaptive sampling strategy was employed by randomly downsampling the majority classes (Normal, Wheeze, and Fine_Crackle), while the minority classes (Coarse_Crackle, Rhonchi, Stridor, and Wheeze_Crackle) were retained at their original size, resulting in a moderately imbalanced dataset of 8991 segments. A fixed random seed (42) was used for the downsampling procedure for reproducibility. Table 1 summarizes, for each class, the number of original samples, the balancing strategy applied, and the final class distribution. No additional digital filtering was applied before feature extraction to preserve the original GWOP structure of the respiratory signals.
Each one second respiratory segment obtained during the segmentation stage was independently processed using the GWOP descriptor. For each segment, GWOP distributions were computed across multiple embedding dimensions, entropic indices, and temporal delays. Specifically, embedding dimensions were considered. The weighting parameter was evaluated in the range , resulting in 21 different weighting configurations, while the time delay parameter was evaluated as , resulting in five temporal configurations. The descriptors obtained from all combinations of these parameters were concatenated to form a single fixed-length feature representation. The dimensionality of the GWOP feature vector is thus . Accordingly, each respiratory segment was represented by a fixed-length 15750-dimensional GWOP feature vector. This high dimensional representation preserves the nonlinear ordinal dynamics captured across multiple embedding dimensions, weighting factors, and temporal delays, providing a comprehensive characterization of each respiratory segment. Consequently, the final balanced dataset contains 8991 respiratory sound segments and 15750 GWOP features.
2.4. Classification
An eXtreme Gradient Boosting (XGBoost) model was trained to automate the respiratory sound classification. XGBoost [26] is an ensemble learning method that constructs an additive sequence of decision trees by minimizing a regularized objective function through a weighed second-order gradient optimization. This particular classification model was selected given that its intrinsic feature importance measure (based on gradient gain enables) post-hoc analysis of the contribution of individual GWOP features and their aggregation according to the parameters. This provides interpretable insights into the discriminative characteristics captured by the ordinal representation. Also, the computational efficiency of the model makes it suitable for the high-dimensional feature spaces [27]. At the same time, support for sample weighting allows class imbalance to be explicitly addressed during training without requiring additional resampling procedures. As mentioned above, majority classes were reduced through random downsampling (see Table 1), and the residual imbalance, ranging from 306 instances for Stridor to 2038 for Normal, was further addressed during training through inverse-frequency sample weighting. Thus, to mitigate potential biases, each training sample was weighted according to the inverse frequency of its corresponding class, allowing the classifier to assign greater importance to minority classes during the learning process [28,29].
The 8991 labeled windows were partitioned into a training set (80 %, ) and a held-out test set (20 %, ) using a stratified random split, preserving the original class proportions in both subsets. The held-out (test) set was used for final performance evaluation and was never exposed during model development. The XGBoost hyperparameters were set as follows: number of estimators n_estimators ; maximum tree depth max_depth ; learning rate learning_rate ; row sub sampling subsample ; column subsampling per tree colsample_bytree ; multiclass objective objective =multi:softprob; evaluation metric eval_metric = mlogloss. These values were selected based on established practice for high-dimensional tabular data [26] and kept fixed to provide a reproducible baseline that isolates the contribution of the GWOP feature representation. All experiments were conducted using Python 3.x and the XGBoost library. Model training and evaluation were performed on a workstation equipped with an NVIDIA GeForce RTX 5070 Ti GPU with 12 GB of VRAM, 32 GB of system memory, and an Intel Core Ultra 7 255HX processor. This hardware configuration provided sufficient computational resources for training the gradient-boosted decision tree models on the high dimensional GWOP feature matrix.
3. Results
This section presents the experimental validation of the proposed GWOP descriptor for respiratory sound analysis. The evaluation is designed to assess the discriminative capability of the entropy-based representations generated from respiratory sound segments. The analysis is organized into four main stages: (i) baseline evaluation of the GWOP feature representation using an XGBoost classifier as a supervised validation tool, (ii) assessment of the effect of hyperparameter optimization on the reliability of the descriptor evaluation, (iii) ablation analysis of the Gain-based feature selection strategy to identify the most informative GWOP components and facilitate the interpretation of the extracted representations, and (iv) comparison of the GWOP representation with conventional spectral features for respiratory sound classification.
3.1. Baseline Validation of GWOP Representations
The discriminative capability of the proposed GWOP feature representation was initially assessed using an XGBoost classifier as a supervised evaluation tool. A 5-fold cross-validation strategy was applied on the training feature set to quantify the consistency of the information encoded by the entropy based descriptors. As shown in Table 2, the obtained results exhibit stable performance across all folds, achieving a mean accuracy of 0.4695 (± 0.0120) and a macro F1-score of 0.4571 (± 0.0190). The low variability among folds indicates that the extracted GWOP representations provide consistent class related information and that the observed performance is not dependent on a specific data partition. These results establish a reliable baseline for analyzing the contribution of the different GWOP configurations and feature selection strategies investigated in the following experiments.
3.2. Effects of Hyperparameter Optimization
Figure 4 compares the normalized confusion matrices obtained using the baseline and optimized XGBoost configurations as validation models for the GWOP representation. The optimization process maintains the general discrimination pattern provided by the entropy-based descriptors while producing moderate improvements in class-wise recognition. In particular, the optimized configuration leads to a slight increase in recall for all classes except stridor. The largest improvement is observed for Wheeze_Crackle, with recall increasing from 56% to 62%. The confusion patterns remain consistent between both configurations, highlighting the intrinsic difficulty of separating specific respiratory sound categories. Fine_Crackle and Normal samples exhibit mutual confusion, suggesting overlapping acoustic characteristics that are not completely resolved by the GWOP representation. Likewise, Wheeze samples show considerable similarity with Fine_Crackle and Normal classes.
3.3. Analysis of Informative GWOP Components via Gain-Based Feature Selection
An additional analysis was conducted to investigate the contribution of individual GWOP components and identify the most informative features within the high-dimensional entropy-based representation. A Gain-based feature selection strategy was applied to quantify the relative importance of each descriptor and evaluate whether the dimensionality of the GWOP representation could be reduced while preserving its discriminative capability. We ranked the features based on cumulative gain and then progressively reduced the feature set by retaining decreasing percentages of the total number of features. The feature set size was progressively reduced from 50% to 0.025% in logarithmic steps. Table 3 and Figure 5 present the evaluation results obtained using the top-ranked retained features based on the cumulative gain.
The complete GWOP representation, comprising 15750 features, achieved a macro-F1 score of 0.4758, with a macro-specificity of 0.9086, macro-precision of 0.5665, and macro-sensitivity of 0.4507. Progressive reductions from 100% to 1% of the top features did not result in a noticeable degradation in the classification performance. In fact, the best performance was obtained when retaining the top 10% of the features, with a macro-F1 score of 0.4977, macro-specificity of 0.9112, macro-precision of 0.5695, and macro-sensitivity of 0.4732. For thresholds below 0.1% of the top features, all evaluation metrics decreased by approximately 0.1 points compared with the values observed at higher thresholds.
The same ablation approach was used to assess how the performance of individual classes changed as the number of retained features was reduced. The per-class performance metrics are shown in Figure 6. To further investigate the internal organization of the most informative GWOP descriptors, the 10% highest-ranked features according to the gain importance of the complete model were analyzed in terms of the parameters (see Table 4). Figure 7 complements this analysis by comparing the normalized confusion matrices obtained using the complete GWOP representation and the top-10% Gain-selected subset.
3.4. Comparison with Conventional Spectral Features
To further assess the discriminative capability of the proposed GWOP representation, its performance was compared with a conventional spectral representation based on Mel-Frequency Cepstral Coefficients (MFCCs), which are widely used for respiratory sound analysis. For each 1-second segment sampled at 8 kHz, 20 MFCC coefficients were extracted using a 512-point FFT, a hop length of 256 samples, and a Hann window. The coefficients obtained from all analysis frames were concatenated into a single feature vector. Both MFCC and GWOP representations were evaluated using the same train/test partition and the same optimized XGBoost configuration to ensure a fair comparison between feature spaces.
Table 5 summarizes the evaluation results obtained with both representations. The GWOP descriptor achieved superior overall discrimination compared with MFCCs. Cohen’s kappa increases from 0.2874 to 0.3923, a relative improvement of 36% compared to the 20% relative gain in accuracy; since kappa discounts agreement expected by chance, this indicates that the improvement is not attributable to the class distribution. Balanced accuracy also increases more than accuracy (0.3750 to 0.4796 against 0.4202 to 0.5053), confirming that the gain is concentrated in the minority classes. Finally, the macro AUC rises from 0.7860 to 0.8383, indicating greater class separability in the feature space rather than a more favorable decision threshold. This consistent advantage indicates that the ordinal information captured by GWOP provides additional class-related information beyond that contained in conventional spectral features.
The class-wise analysis shows that GWOP improves the F1-score for all respiratory sound categories. with gains ranging from 0.02 for Wheeze_Crackle to 0.26 for Stridor. The largest improvement is observed for Coarse Crackle and Stridor, where the F1-score increases from 0.23 to 0.42 and 0.26 to 0.51 respectively, due to simultaneous gains in precision and recall. Similar improvements are obtained for Fine Crackle, Ronchhi, and Wheeze, suggesting that the entropy-based ordinal representation is particularly effective for capturing transient acoustic structures associated with adventitious respiratory events. Figure 8 compares the normalized confusion matrices obtained with both feature representations. The overall confusion structure remains similar, indicating that some class ambiguities are associated with intrinsic acoustic similarities between respiratory sound categories rather than exclusively with the selected representation. Nevertheless, the GWOP-based representation exhibits improved diagonal concentration for all adventitious sound classes, supporting the quantitative improvements observed in Table 5. In the particular case of Coarse Crackle, the conventional representation shows a substantial confusion with Wheeze, with 31% of Coarse Crackle samples classified as Wheeze. In contrast, the GWOP representation reduces this confusion to 15%, although this is accompanied by an increase in the misclassification of Coarse Crackle as Fine Crackle, from 14% to 22%, so that the residual error shifts from Wheeze to Fine Crackle. Overall, the recall for Coarse Crackle increases from 15% to 31%. For Stridor, the conventional representation shows a strong confusion with the Normal class, with only 20% of Stridor samples correctly classified and a similar proportion misclassified as Normal. This is compounded by a precision of 0.36, indicating that the classifier assigns this label with little discrimination. With GWOP, both aspects improve: recall rises to 38% and precision to 0.79, the largest gain of any class in Table 5. The model therefore becomes highly reliable when it predicts Stridor, despite this being the least represented class in the dataset (n = 306).
4. Discussion
The experimental results demonstrate that the proposed GWOP-based entropy representation provides a meaningful and discriminative feature space for respiratory sound characterization. The stable performance across cross-validation folds (accuracy: ; macro-F1: indicates that the extracted descriptors capture reproducible acoustic patterns rather than characteristics dependent on a particular data partition. Although hyperparameter optimization resulted in moderate improvements, the overall confusion structure remained largely unchanged, suggesting that the remaining ambiguities are primarily associated with intrinsic similarities between respiratory sound categories rather than with the specific configuration of the validation classifier. These persistent confusion trends indicate that the observed limitations may be related to the complexity of the underlying acoustic phenomena rather than solely to the classifier configuration.
The gain-based feature selection provides compelling evidence for the informational efficiency of the GWOP representation. Reducing the feature space from 15750 to 1575 descriptors (10%) preserved and slightly improved performance (macro-F1 from 0.4758 to 0.4977), indicating that discriminative information is concentrated in a compact subset of ordinal patterns. Two mechanisms may generate uninformative components within the GWOP representation. First, rarely visited ordinal patterns—particularly for D = 5, where 120 patterns are estimated from a single one-second window—yield per-segment probabilities based on few occurrences, so that their variance across segments is dominated by estimation noise rather than by class differences. Second, adjacent configurations produce strongly correlated descriptors, so the effective dimensionality of the representation is considerably lower than 15750. Gain-based selection therefore does not merely produce a more compact representation, it also discards confounding descriptors that are stochastic and which can actively mislead the classifier.
Class-wise ablation reveals two distinct behaviors. Rhonchi and Wheeze reach high F1 scores even with very small feature subsets. Their metrics are already substantial at 0.1% of the descriptors and saturate with more features. Both are continuous adventitious sounds with sustained, quasi-periodic oscillatory structure. A few ordinal configurations appear sufficient to describe this regularity. Normal segments behave similarly, although at a lower overall level. Stridor and Coarse Crackle follow the opposite trend. Their metrics remain low below 1% of the features and improve markedly as the subset grows. Stridor shows the steepest change, with F1 rising from about 0.20 at 0.1% to values above 0.45 once 1–10% of the descriptors are retained. Its precision increases in the same direction, indicating that additional descriptors provide discriminative rather than merely redundant information. This asymmetry suggests that the number of ordinal descriptors required is class-dependent rather than a global property of the representation. A similar behavior has been reported in sleep stage characterization, where stages with stereotyped dynamics are separable with compact ordinal descriptions, whereas transitional stages require richer representations [27].
The parameter composition of the top-10% subset reported in Table 4 is dominated by (74% of top features), with a non-uniform distribution of temporal delays. The proportion of selected descriptors increases monotonically from 15% at to 25% at . This suggests that respiratory sound discrimination benefits from ordinal relationships sampled over wider temporal spans rather than from strictly consecutive samples. The analysis of the entropic index q offers particularly insightful findings. While was frequently selected for fine temporal scales, the broad presence of both positive () and negative () values demonstrates that discriminative information is distributed across different fluctuation regimes. Positive q values emphasize high-amplitude fluctuations (wheezes, rhonchi), whereas negative values enhance low amplitude fluctuations (fine crackles, normal breathing texture). This complementary sensitivity provides direct empirical support for the generalized entropy framework and confirms that different respiratory sound categories operate at distinct amplitude scales.
Comparison with MFCC features further substantiates the informational advantage of GWOP. Improvements in accuracy (from 42% to 50%) and Cohen’s kappa (from 0.2874 to 0.3923) indicate that ordinal dynamics capture complementary information beyond the spectral envelope. The largest gains occur in Stridor and Coarse Crackle, the smallest in Wheeze_Crackle. This ordering is consistent with what each representation encodes. MFCCs summarise the spectral envelope over analysis frames, which suits sounds whose identity resides in a stable spectral signature. Stridor and crackles are instead defined by their temporal morphology. Brief, sharply delimited events whose spectral average over a one-second window are easily dominated by the surrounding breathing sound. Ordinal descriptors operate on the local rank structure of the waveform and are therefore less affected by this averaging. The improvement in Stridor precision is particularly relevant in this respect (from 0.3636 to 0.7931), since it indicates that the ordinal representation supplies a positive signature for the class rather than merely relaxing a decision threshold. GWOPs reduce confusion between Coarse Crackle and Wheeze from 31% to 15%, and increase Stridor recognition from 20% to 38%. These are clinically significant improvements, as crackles and stridor are key indicators of interstitial lung diseases and upper airway obstruction, respectively.
5. Conclusions
This work explored the applicability of Generalized Weighed Ordinal Pattern probability distribution as a feature representation for the characterization of adventitious respiratory sounds. Rather than summarizing the ordinal information into a single entropy value, the proposed approach directly features the complete probability distribution, preserving richer information about the nonlinear temporal dynamics of respiratory signals. The discriminative capability of this representation was evaluated using XGBoost as a classification model, while the XGBoost Gain criterion was employed as an analytical tool to investigate the contribution of individual descriptor components. Results demonstrated that the proposed GWOP representation provides a more informative characterization than conventional MFCC features under the same evaluation protocol. Furthermore, the Gain-based analysis showed that the discriminative information contained in the high-dimensional GWOP feature space is concentrated in a compact subset of descriptors. Beyond the classification results, the proposed framework provides a systematic way to analyze the temporal organization of respiratory signals through weighted ordinal dynamics, offering insights that are not directly available from conventional spectral representations.
Despite these findings, respiratory sound characterization remains a challenging problem due to the high intra-class variability and acoustic similarity among several categories. Future studies should evaluate the generalization capability of the GWOP representation on different databases and acquisition protocols. Related work implies that GWOP may achieve valuable acquisition-independent results [30]. Also, it is worth to investigate the combination of GWOP with complementary representations or temporal modeling approaches across the complete respiratory cycle to further explore the information contained in the sound dynamics. Finally, since the most informative descriptors arose at the highest embedding dimension (), further investigation should focus on the performance of even higher embedding dimensions (). However, this should be carefully balanced against the factorial growth of the ordinal pattern space and the increasing sparsity of the GWOP representation.
Author Contributions
Conceptualization, JILP, CDD and CD; methodology, JILP and CDD; software, JILP and CDD; validation, JILP and CDD; formal analysis, JILP, CDD and CD; investigation, JILP, CDD and CD; resources, CD; data curation, JILP; writing—original draft preparation, JILP, CDD; writing—review and editing, CD; visualization, JILP; supervision, CD; project administration, CD; funding acquisition, CD. All authors have read and agreed to the published version of the manuscript.
Funding
This research was partially funded by grant PGI 24/K093 of the Science and Technology Office of the Universidad Nacional del Sur (Argentina).
Institutional Review Board Statement
Ethical review and approval were waived for this study given that publicly available data were used.
Informed Consent Statement
Not applicable.
Data Availability Statement
Models and scripts used in this study are available from the corresponding author under reasonable request.
Acknowledgments
The authors thank Dr. Francisco R. Iaconis for granting access to a pre-existing ordinal-pattern codebase from earlier research. The Generalized Weighted Ordinal Pattern software used in this study was developed by the authors on that basis.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- GBD Chronic Respiratory Disease Collaborators. Prevalence and attributable health burden of chronic respiratory diseases, 1990–2017: a systematic analysis for the Global Burden of Disease Study 2017. Lancet Respir. Med. 2020, 8, 585–596. [Google Scholar] [CrossRef] [PubMed]
- World Health Organization. Chronic respiratory diseases. Accessed. 2025. (accessed on 2026-07-17).
- Pasterkamp, H.; Kraman, S.S.; Wodicka, G.R. Respiratory sounds: Advances beyond the stethoscope. Am. J. Respir. Crit. Care Med. 1997, 156, 974–987. [Google Scholar] [PubMed]
- Reichert, S.; Gass, R.; Brandt, C.; Andrès, E. Analysis of respiratory sounds: state of the art. Clin. Med. Circ. Respir. Pulm. Med. 2008, 2, 45–58. [Google Scholar] [CrossRef] [PubMed]
- Gurung, A.; Scrafford, C.; Tielsch, J.; Levine, O.; Checkley, W. Computerized lung sound analysis as a diagnostic aid for the detection of abnormal lung sounds: A systematic review and meta-analysis. Respir. Med. 2011, 105, 1393–1402. [Google Scholar] [CrossRef] [PubMed]
- Pramono, R.X.A.; Bowyer, S.; Rodriguez-Villegas, E. Automatic adventitious respiratory sound analysis: A systematic review. PLoS ONE 2017, 12, e0177926. [Google Scholar] [CrossRef] [PubMed]
- Rocha, B.M.; Filos, D.; Mendes, L.; Vogiatzis, I.M.; Perantoni, E.; Kaimakamis, E.; Nunes, U.; Paiva, R.P. An open access database for the evaluation of respiratory sound classification algorithms. Physiol. Meas. 2019, 40, 035001. [Google Scholar] [CrossRef]
- Zhang, Q.; Zhang, J.; Yuan, J.; Huang, H.; Zhang, Y.; Zhang, B.; Lv, G.; Lin, S.; Wang, N.; Liu, X.; et al. SPRSound: Open-Source SJTU Paediatric Respiratory Sound Database. IEEE Trans. Biomed. Circuits Syst. 2022, 16, 867–881. [Google Scholar] [CrossRef] [PubMed]
- 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. 2020, 14, 535–544. [Google Scholar] [CrossRef] [PubMed]
- Demir, F.; Ismael, A.M.; Sengur, A. Classification of Lung Sounds With CNN Model Using Parallel Pooling Structure. IEEE Access 2020, 8, 105376–105383. [Google Scholar] [CrossRef]
- Bohadana, A.; Izbicki, G.; Kraman, S.S. Fundamentals of Lung Auscultation. N. Engl. J. Med. 2014, 370, 744–751. [Google Scholar] [CrossRef] [PubMed]
- De Oliveira, L.P.; Roque, W.L.; Custódio, R.F. Lung sound analysis with time-dependent fractal dimensions. Chaos Solitons Fractals 1999, 10, 1419–1423. [Google Scholar] [CrossRef]
- Gnitecki, J.; Moussavi, Z. The fractality of lung sounds: A comparison of three waveform fractal dimension algorithms. Chaos Solitons Fractals 2005, 26, 1065–1072. [Google Scholar] [CrossRef]
- Ahlstrom, C.; Johansson, A.; Hult, P.; Ask, P. Chaotic dynamics of respiratory sounds. Chaos Solitons Fractals 2006, 29, 1054–1062. [Google Scholar] [CrossRef]
- Bandt, C.; Pompe, B. Permutation entropy: A natural complexity measure for time series. Phys. Rev. Lett. 2002, 88, 174102. [Google Scholar] [CrossRef] [PubMed]
- Kantz, H.; Schreiber, T. Nonlinear Time Series Analysis, 2nd ed.; Cambridge University Press: Cambridge, UK, 2004. [Google Scholar]
- Zanin, M.; Zunino, L.; Rosso, O.A.; Papo, D. Permutation entropy and its main biomedical and econophysics applications: A review. Entropy 2012, 14, 1553–1577. [Google Scholar] [CrossRef]
- Amigó, J.M. Permutation Complexity in Dynamical Systems: Ordinal Patterns, Permutation Entropy and All That; Springer: Berlin, Germany, 2010. [Google Scholar] [CrossRef]
- Zunino, L.; Soriano, M.C.; Fischer, I.; Rosso, O.A.; Mirasso, C.R. Permutation-information-theory approach to unveil delay dynamics from time-series analysis. Phys. Rev. E 2010, 82, 046212. [Google Scholar] [CrossRef] [PubMed]
- Iaconis, F.; Gandica, A.; Punta, J.; Delrieux, C.; Gasaneo, G. Information-theoretic characterization of eye-tracking signals with relation to cognitive tasks. Chaos An. Interdiscip. J. Nonlinear Sci. 2021, 31, 033107. [Google Scholar] [CrossRef] [PubMed]
- Rizal, A.; Hidayat, R.; Nugroho, H.A. Comparison of Multiscale Entropy Techniques for Lung Sound Classification. Indones. J. Electr. Eng. Comput. Sci. 2018, 12, 984–994. [Google Scholar] [CrossRef]
- Fraiwan, L.; Hassanin, O.; Fraiwan, M.; Khassawneh, B.; Ibnian, A.M.; Alkhodari, M. Automatic identification of respiratory diseases from stethoscopic lung sound signals using ensemble classifiers. Biocybern. Biomed. Eng. 2021, 41, 1–14. [Google Scholar] [CrossRef]
- Rosso, O.A.; Larrondo, H.A.; Martin, M.T.; Plastino, A.; Fuentes, M.A. Distinguishing noise from chaos. Phys. Rev. Lett. 2007, 99, 154102. [Google Scholar] [CrossRef] [PubMed]
- Fadlallah, B.; Chen, B.; Keil, A.; Príncipe, J. Weighted-permutation entropy: A complexity measure for time series incorporating amplitude information. Phys. Rev. E 2013, 87, 022911. [Google Scholar] [CrossRef] [PubMed]
- Stosic, D.; Stosic, D.; Stosic, T.; Stosic, B. Generalized weighted permutation entropy. Chaos An. Interdiscip. J. Nonlinear Sci. 2022, 32, 103105. [Google Scholar] [CrossRef] [PubMed]
- Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, New York, NY, USA, 2016; pp. 785–794. [Google Scholar] [CrossRef]
- Duarte, C.D.; Pacheco, M.; Iaconis, F.R.; Rosso, O.A.; Gasaneo, G.; Delrieux, C.A. Statistical Complexity Analysis of Sleep Stages. Entropy 2025, 27. [Google Scholar] [CrossRef] [PubMed]
- King, G.; Zeng, L. Logistic Regression in Rare Events Data. Political Anal. 2001, 9, 137–163. [Google Scholar] [CrossRef]
- He, H.; Garcia, E.A. Learning from Imbalanced Data. IEEE Trans. Knowl. Data Eng. 2009, 21, 1263–1284. [Google Scholar] [CrossRef]
- Duarte, C.D.; Arlenghi, A.; Iaconis, F.R.; Gasaneo, G.; Delrieux, C. Disentangling EEG Fingerprinting and Sleep Biomarkers Using Generalized Weighted Ordinal Patterns. Brain Sci. 2026, 16, 793. [Google Scholar] [CrossRef] [PubMed]
Figure 1.
Overview of the proposed framework for respiratory sound classification using Generalized Weighted Ordinal Pattern (GWOP) feature extraction and XGBoost-based modeling.
Figure 1.
Overview of the proposed framework for respiratory sound classification using Generalized Weighted Ordinal Pattern (GWOP) feature extraction and XGBoost-based modeling.

Figure 2.
Representative waveforms of respiratory sound recordings from each event in the SPRSound database.
Figure 2.
Representative waveforms of respiratory sound recordings from each event in the SPRSound database.

Figure 3.
Effect of time delay on ordinal pattern construction for different embedding dimensions.

Figure 4.
Normalized confusion matrices for the (a) baseline and (b) optimized XGBoost classifier.

Figure 5.
Cross-validation performance across GWOP feature subsets of varying size, retained according to their individual XGBoost Gain ranking. Each panel reports a different macro-averaged classification metric as a function of the percentage of GWOP features retained (log scale). Points indicate the mean value across the five folds of the cross-validation procedure, and error bars indicate the corresponding standard deviation.
Figure 5.
Cross-validation performance across GWOP feature subsets of varying size, retained according to their individual XGBoost Gain ranking. Each panel reports a different macro-averaged classification metric as a function of the percentage of GWOP features retained (log scale). Points indicate the mean value across the five folds of the cross-validation procedure, and error bars indicate the corresponding standard deviation.

Figure 6.
F1, specificity, recall, and precision metrics for respiratory sound classification separated by classes across reduced sets of top-ranked features.
Figure 6.
F1, specificity, recall, and precision metrics for respiratory sound classification separated by classes across reduced sets of top-ranked features.

Figure 7.
Normalized confusion matrices obtained using the complete and Gain-selected GWOP representations. The left panel (a) corresponds to the complete GWOP feature representation (100%, 15750 features), while the right panel (b) corresponds to the top-10% Gain-selected subset (1575 features), ranked by individual feature Gain.
Figure 7.
Normalized confusion matrices obtained using the complete and Gain-selected GWOP representations. The left panel (a) corresponds to the complete GWOP feature representation (100%, 15750 features), while the right panel (b) corresponds to the top-10% Gain-selected subset (1575 features), ranked by individual feature Gain.

Figure 8.
Normalized confusion matrices obtained using (a) the conventional MFCC representation and (b) the proposed GWOP descriptor with Gain-based Top-10% feature selection, evaluated with the optimized XGBoost model as a common validation classifier. GWOP provides a more favorable classification pattern across all adventitious respiratory sound classes.
Figure 8.
Normalized confusion matrices obtained using (a) the conventional MFCC representation and (b) the proposed GWOP descriptor with Gain-based Top-10% feature selection, evaluated with the optimized XGBoost model as a common validation classifier. GWOP provides a more favorable classification pattern across all adventitious respiratory sound classes.

Table 1.
Class balancing process and final class distribution. Majority classes (N, W, FC) were balanced by random downsampling, whereas minority classes (CC, R, S, WC) were not augmented and retained their original sample sizes.
Table 1.
Class balancing process and final class distribution. Majority classes (N, W, FC) were balanced by random downsampling, whereas minority classes (CC, R, S, WC) were not augmented and retained their original sample sizes.
| Class | Original | Operation | Final |
|---|---|---|---|
| N | 5096 | Random downsampling | 2038 |
| W | 4307 | Random downsampling | 1722 |
| FC | 5080 | Random downsampling | 2032 |
| CC | 654 | – | 654 |
| R | 917 | – | 917 |
| S | 306 | – | 306 |
| WC | 1322 | – | 1322 |
| Total | 17682 | – | 8991 |
Table 2.
Five-fold cross-validation results for the GWOP feature representation.
| Fold | Acc | F1-mac | F1-w | Prec (mac) | Rec (mac) | Spec (mac) | AUC |
|---|---|---|---|---|---|---|---|
| 1 | 0.4663 | 0.4594 | 0.4648 | 0.5693 | 0.4320 | 0.9051 | 0.8194 |
| 2 | 0.4892 | 0.4848 | 0.4867 | 0.5646 | 0.4588 | 0.9094 | 0.8228 |
| 3 | 0.4701 | 0.4572 | 0.4677 | 0.5545 | 0.4312 | 0.9061 | 0.8278 |
| 4 | 0.4569 | 0.4527 | 0.4558 | 0.5302 | 0.4276 | 0.9036 | 0.8147 |
| 5 | 0.4652 | 0.4315 | 0.4567 | 0.4988 | 0.4203 | 0.9056 | 0.8200 |
| Mean | 0.4695 | 0.4571 | 0.4663 | 0.5435 | 0.4340 | 0.9060 | 0.8210 |
| Std | 0.0120 | 0.0190 | 0.0125 | 0.0292 | 0.0146 | 0.0021 | 0.0048 |
Table 3.
Ablation analysis of the GWOP representation using top-N (by feature count, ranked by XGBoost Gain) feature selection. Results are obtained on the held-out test set. For each Gain threshold, N indicates the number of retained GWOP features for each embedding dimension (D), while represents the percentage of retained features relative to the complete feature set of that dimension.
Table 3.
Ablation analysis of the GWOP representation using top-N (by feature count, ranked by XGBoost Gain) feature selection. Results are obtained on the held-out test set. For each Gain threshold, N indicates the number of retained GWOP features for each embedding dimension (D), while represents the percentage of retained features relative to the complete feature set of that dimension.
| Total features | D | N | F1 | Spec. | Prec. | Sens. | AUC |
|---|---|---|---|---|---|---|---|
| 15750 (100%) | 3 | 630/630 | 0.4758 | 0.9086 | 0.5665 | 0.4507 | 0.8336 |
| 4 | 2520/2520 | ||||||
| 5 | 12600/12600 | ||||||
| 7875 (50%) | 3 | 423/630 | 0.4749 | 0.9082 | 0.5593 | 0.4509 | 0.8352 |
| 4 | 1657/2520 | ||||||
| 5 | 5795/12600 | ||||||
| 3150 (20%) | 3 | 170/630 | 0.4904 | 0.9105 | 0.5735 | 0.4648 | 0.8356 |
| 4 | 666/2520 | ||||||
| 5 | 2314/12600 | ||||||
| 1575 (10%) | 3 | 78/630 | 0.4977 | 0.9112 | 0.5695 | 0.4732 | 0.8366 |
| 4 | 327/2520 | ||||||
| 5 | 1170/12600 | ||||||
| 788 (5%) | 3 | 43/630 | 0.4910 | 0.9101 | 0.5522 | 0.4673 | 0.8304 |
| 4 | 170/2520 | ||||||
| 5 | 575/12600 | ||||||
| 315 (2%) | 3 | 18/630 | 0.4953 | 0.9090 | 0.5629 | 0.4699 | 0.8249 |
| 4 | 79/2520 | ||||||
| 5 | 218/12600 | ||||||
| 158 (1%) | 3 | 9/630 | 0.4820 | 0.9086 | 0.5288 | 0.4637 | 0.8180 |
| 4 | 42/2520 | ||||||
| 5 | 107/12600 | ||||||
| 79 (0.5%) | 3 | 7/630 | 0.4513 | 0.9032 | 0.4831 | 0.4393 | 0.8042 |
| 4 | 19/2520 | ||||||
| 5 | 53/12600 | ||||||
| 16 (0.1%) | 3 | 2/630 | 0.3413 | 0.8920 | 0.3436 | 0.3521 | 0.7365 |
| 4 | 4/2520 | ||||||
| 5 | 10/12600 | ||||||
| 8 (0.05%) | 3 | 1/630 | 0.3152 | 0.8888 | 0.3164 | 0.3299 | 0.7045 |
| 4 | 2/2520 | ||||||
| 5 | 5/12600 | ||||||
| 4 (0.025%) | 3 | 0/630 | 0.2728 | 0.8820 | 0.2717 | 0.2949 | 0.6730 |
| 4 | 1/2520 | ||||||
| 5 | 3/12600 |
Table 4.
Distribution of the top 1575 most informative GWOP features (top 10% by feature count) identified by XGBoost Gain analysis. For each embedding dimension (D), the table reports the contribution of each dimension, the distribution of temporal delays (), and the dominant values of the entropic index (q).
Table 4.
Distribution of the top 1575 most informative GWOP features (top 10% by feature count) identified by XGBoost Gain analysis. For each embedding dimension (D), the table reports the contribution of each dimension, the distribution of temporal delays (), and the dominant values of the entropic index (q).
| Dimension | Freq. | Dominant q values | |
|---|---|---|---|
| (74%) | 1 | 15% | (11%), (10%), (8%), (7% each), remaining q values (~3% each). |
| 2 | 18% | (9% each), (7%), (6% each), (5% each), remaining q values (~3% each). | |
| 3 | 18% | (7% each), (6% each), (5% each), (4% each), remaining q values (~2% each). | |
| 4 | 23% | (9%), (8%), (7% each), (6% each), remaining q values (~3% each). | |
| 5 | 25% | (13%), (10%), (7%), (6% each), remaining q values (~3% each). | |
| (21%) | 1 | 22% | (14%), (11%), (8% each), (7% each), remaining q values (~4% each). |
| 2 | 20% | (18%), (17%), (6% each), (5% each), remaining q values (~3% each). | |
| 3 | 21% | (16%), (11% each), (10%), (7%), remaining q values (~4% each). | |
| 4 | 16% | (17%), (15%), (13%), (10%), remaining q values (~4% each). | |
| 5 | 21% | (14%), (13%), (10%), (9% each), remaining q values (~4% each). | |
| (5%) | 1 | 22% | (24%), (12% each), (6% each). |
| 2 | 24% | (21%), (16%), (11% each), (5% each). | |
| 3 | 19% | (27%), (13% each), (7% each). | |
| 4 | 21% | (25% each), (19%), (12%), (6% each). | |
| 5 | 14% | (18% each), (9% each). |
Table 5.
Comparison between MFCC and GWOP feature representations using the optimized XGBoost classifier as a common evaluation model. In all cases the later performed better.
Table 5.
Comparison between MFCC and GWOP feature representations using the optimized XGBoost classifier as a common evaluation model. In all cases the later performed better.
| Class / Metric | MFCC | GWOP | ||||
|---|---|---|---|---|---|---|
| Prec. | Rec. | F1 | Prec. | Rec. | F1 | |
| CC | 0.4878 | 0.1527 | 0.2326 | 0.6667 | 0.3053 | 0.4188 |
| FC | 0.3733 | 0.3440 | 0.3581 | 0.4344 | 0.4963 | 0.4633 |
| N | 0.4110 | 0.4755 | 0.4409 | 0.4874 | 0.5196 | 0.5030 |
| R | 0.4901 | 0.4044 | 0.4431 | 0.6497 | 0.5574 | 0.6000 |
| S | 0.3636 | 0.1967 | 0.2553 | 0.7931 | 0.3770 | 0.5111 |
| W | 0.4234 | 0.4725 | 0.4466 | 0.5623 | 0.4841 | 0.5202 |
| WC | 0.4474 | 0.5795 | 0.5050 | 0.4579 | 0.6174 | 0.5258 |
| Test Accuracy | 0.4202 | 0.5053 | ||||
| Balanced Accuracy | 0.3750 | 0.4796 | ||||
| Cohen’s Kappa | 0.2874 | 0.3923 | ||||
| AUC Macro | 0.7860 | 0.8383 | ||||
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. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.