A subscription to JoVE is required to view this content. Sign in or start your free trial.

Method Article

Asthma Detection Research Based on Voice Signal Processing and Machine Learning

1.5K views

DOI:

10.3791/67742

July 22nd, 2025

In This Article

Summary

This study employed voice signal analysis and machine learning methods, utilizing MATLAB to extract distinctive voice features for non-invasive early detection of asthma. The Support Vector Machine (SVM) and Random Forest (RF) algorithms demonstrated comparable performance in terms of overall classification accuracy, although SVM may achieve a better balance between sensitivity and specificity.

Abstract

To analyze voice signals and identify asthma patients using voice signal analysis and machine learning techniques, we collected clear, low-noise fixed-pattern voice signals from 50 asthma patients and 50 healthy controls to build an analysis database. The research conducted multi-dimensional voice signal analysis based on MATLAB and selected voice feature indicators with significant differences between asthma patients and healthy controls. After dimensionality reduction analysis on differential phonetic features, the processed features were incorporated into subsequent SVM and RF modeling and classification research.

The study established over 400 voice feature indicators related to diagnosis, of which 20 indicators showed significant differences between asthma patients and healthy controls (P < 0.01). In the classification study, both the SVM and RF models achieved identical accuracy rates of 87% on the test set, with AUC values of 0.95 for SVM and 0.93 for RF. This demonstrates their comparable performance in terms of overall classification accuracy, while the disparity in AUC values suggests that the SVM model may achieve a better trade-off between sensitivity and specificity. Thus, this paper not only provides a new method for non-invasive early detection of asthma but also lays the foundation for further application and optimization of this method in real-world settings.

Introduction

According to data from the China Pulmonary Health (CPH) study, the prevalence of asthma among Chinese adults is 4.2%, with physicians diagnosing only 28.8% of asthma patients, and a mere 5.6% receiving inhaled corticosteroid treatment1. These figures indicate a low rate of asthma diagnosis and treatment in China, highlighting the urgent need to enhance awareness and draw attention to asthma among the public and healthcare professionals. Current diagnostic methods for asthma are varied, including clinical history and physical examination, pulmonary function testing, and Fractional exhaled Nitric Oxide (FeNO) measurement, but each has its limitations to varying degrees2,3,4. Moreover, regular monitoring of asthma is crucial for disease management; systematic monitoring of symptoms and lung function can effectively prevent asthma exacerbations, improve the patient's quality of life, and reduce emergency visits and hospitalizations5,6. However, in practice, these conventional diagnostic methods are often impractical for routine care due to their cost and complexity.

Given the above circumstances, self-monitoring of asthma may play a significant role in disease control. Such monitoring needs to be simple, convenient, and accurate. In this regard, voice offers distinct advantages. Asthma patients often exhibit notable differences in voice characteristics, including reduced maximum phonation time, voice disorders (such as hoarseness, roughness, and vocal fatigue), and significant differences in fundamental frequency and pitch compared to healthy individuals7,8,9. These differences could serve as a potential method for the identification and monitoring of asthma.

Machine learning has demonstrated significant potential in detecting asthma using voice data. Studies have shown that asthma symptoms can be effectively detected by analyzing patients' cough sounds, breath sounds, and other relevant acoustic features. These techniques, including deep learning, neural networks, and other machine learning models, are capable of recognizing characteristic voice patterns and respiratory sound changes in asthma patients10,11,12,13,14,15.

Compared to cough and breath sounds, fixed-pattern voice (such as the pronunciation of numbers 1-9) can be more standardized and controllable. It also facilitates feature extraction, controls voice quality, and is easier for large-scale data collection. Support Vector Machine (SVM) demonstrates strong classification ability when handling high-dimensional data and noisy samples, while Random Forest (RF), with its excellent robustness, ability to handle nonlinear relationships, and feature importance assessment, effectively manages complex voice feature data16,17,18,19,20.

In this study, we used recordings of the digits "123456789" spoken at a normal and steady pace to extract asthma-related voice features. Based on these features, we constructed RF and SVM models for asthma detection. In the future, these models could potentially be integrated into mobile applications to enable the identification of asthma and monitoring of disease progression, thereby helping to prevent asthma exacerbations.

Access restricted. Please log in or start a trial to view this content.

Protocol

The Ethics Committee of Beijing University of Chinese Medicine and its Third Affiliated Hospital approved this study. All participants signed written informed consent before taking part. From July to August 2024, we recruited 50 patients from the Department of Respiratory Medicine at the Third Affiliated Hospital of Beijing University of Chinese Medicine. At the same time, we enrolled 50 healthy individuals as controls.

1. Participant selection

  1. Set the following inclusion criteria.
    1. Among the audio samples where speakers pronounced the digits "123456789" at a normal and steady pace, select those with low background noise and clear articulation.
    2. Ensure that the asthma group has a confirmed diagnosis of asthma based on established clinical criteria by a respiratory specialist, and the control group consists of healthy individuals without respiratory diseases or other conditions that might affect the voice quality.
    3. Select participants aged 18-75 years, with the sex ratio kept consistent between groups.
    4. Obtain written informed consent from all participants for the study.
  2. Set the following exclusion criteria.
    1. Exclude participants with chronic respiratory diseases such as chronic obstructive pulmonary disease (COPD) or interstitial lung disease.
    2. Exclude participants who have experienced acute respiratory infections or disease exacerbations within the past 6 weeks.
    3. Exclude individuals with a history of voice disorders, such as vocal cord problems or laryngitis.
    4. Exclude participants with neurological disorders that might impair voice or cognitive functions.
    5. Exclude individuals with significant hearing impairments.
    6. Exclude participants who have failed to adhere to the study protocol or provide sufficient audio samples.
    7. Exclude individuals who are unable or unwilling to provide informed consent.

2. Study design

  1. Record the participants in an isolated, quiet consultation room (ambient noise < 30 dB) in a natural, comfortable sitting position, maintaining a relaxed state (as shown in Figure 1).
  2. Have the personnel (the sampling personnel) recording the participants obtain the basic information (height, weight, age, etc.) of the recorded participants and verify with the physician whether the participant had a diagnosis of pure asthma.
  3. After collecting the basic information, ask the sampling personnel to adjust the microphone of the recording device to a suitable height, approximately 20-30 cm from the lips.
  4. Collect the audio recordings using a digital recorder, with the sampling rate uniformly set to 44.1 kHz. Calibrate the device prior to daily recording sessions, ensuring an error margin within ≤±1 dB.
  5. Guide the participants to read aloud the numbers 1 through 9 in sequence, maintaining natural voice speed and clear articulation throughout the recording.
  6. Upon completion, save the audio in .wav format.
  7. Remove abnormal audio segments through voice activity detection (VAD) combined with manual verification. Include recordings meeting the signal-to-noise ratio (SNR) criterion of >20 dB in the study.

3. Construction of a voice feature library

NOTE: The speech feature indicator database is a collection of various speech characteristics used to analyze the differences in speech between asthma patients and healthy individuals, supporting early screening and detection of asthma. The specific methodological framework for constructing the speech feature metrics repository is detailed in Table 1. Meanwhile, the process of constructing the voice feature index database for this study has been uploaded to GitHub (https://github.com/Liteng811/speech-feature-index-database-construction). The following steps will primarily describe how to download and run the code from GitHub. 

  1. Install MATLAB on the computer from the MathWorks official website, selecting the appropriate version for the operating system. Check if MATLAB is installed correctly by starting the MATLAB software and typing ver in the command window. If installed correctly, the version information of MATLAB appears.
  2. Install Git from the official Git website (https://git-scm.com/). Confirm the successful installation by entering the following command in the command line (Command Prompt for Windows, Terminal for Mac/Linux): git --version. If installed successfully, the version information for Git appears.
  3. Clone the GitHub Repository.
    1. Open the command line tool and use the following command to clone the repository to the local machine:
      git clone https://github.com/Liteng811/voice-feature-index-database-construction.git
      NOTE: This command will download the content of the GitHub repository to the current working directory and create a folder named voice-feature-index-database-construction
    2. To navigate into this folder to view and manage the downloaded code and files, use the command:
      cd voice-feature-index-database-construction.
  4. Configure the MATLAB Environment.
    1. Launch the MATLAB software.
    2. In MATLAB, click the Set Path button under the Home tab and select Add Folder. Choose the voice-feature-index-database-construction folder that was just cloned and click Save. This will allow MATLAB to recognize and execute all script files in that folder.
    3. In the MATLAB Current Folder window, locate the voice-feature-index-database-construction folder and double-click the voiceH6_batch_3_stage_WAV_tt.m file to open it. This file is the main processing script.
  5. Configure and prepare data.
    1. The code in the repository requires audio files as input. Ensure that the audio files are in .wav or .pcm format.
    2. The file paths for the audio files are hard coded in the repository code (i.e., they are directly written into the code). Modify the paths according to the location of the local files.
  6. Run the code.
    1. After opening the voiceH6_batch_3_stage_WAV_tt.m file, click the Run button, or type the filename in the command window to execute the script:
      voiceH6_batch_3_stage_WAV_tt.
    2. The script requires user interaction. MATLAB will pop up a graphical interface to prompt the user to select the corresponding audio file or folder. Be sure to correctly select the audio file or folder to be processed as prompted.
    3. In case of any issues with the graphical interface freezing or not displaying when running the script in MATLAB, check for potential MATLAB version compatibility issues or ensure the operating system's graphics drivers are functioning correctly.
  7. Output the results. After running, look for a .txt output file to which the script will write the feature extraction results. The output file will save information such as the audio feature recognition results.

4. Data analysis

NOTE: After obtaining the database of voice feature indicators, perform statistical analyses on the data. The specific methodological framework for data analysis is detailed in Table 2. The specific operational procedures are detailed below.

  1. Tests for normality and homogeneity of variance
    NOTE: We conducted tests for Normality and Homogeneity of Variance on the voice feature indicators to determine the appropriate statistical analysis methods. If all groups of indicators met both the normality and homogeneity of variance assumptions, the independent samples t-test was used. Otherwise, we applied the Mann-Whitney U test.
    1. Open the statistical software, click File | Open | Data, and select the data file. Ensure that the variables are properly categorized and displayed in the data view.
    2. Navigate to Analyze | Descriptive Statistics | Explore.
    3. In the dialog box, move the variables to be tested into the Dependent List field.
    4. Click the Plots button in the top-right corner of the window. In the dialog box, select Normality plots with tests and click Continue.
    5. Return to the main window and click OK to perform the normality test.
    6. In the output window, locate the Tests of Normality table. Focus on the significance values (Sig.) of the Kolmogorov-Smirnov (K-S test) and Shapiro-Wilk (S-W test). If Sig. > 0.05, the data follows a normal distribution; if Sig. ≤ 0.05, the data does not follow a normal distribution.
    7. Navigate to Analyze | Compare Means | One-Way ANOVA.
    8. In the dialog box, move the dependent variable to the Dependent List field and the grouping variable (categorical variable) to the Factor field.
    9. Click the Options button on the right-hand side of the dialog box. Select Homogeneity of variance test and click Continue.
    10. Return to the main window and click OK to perform the homogeneity of variance test.
    11. In the output window, locate the Test of Homogeneity of Variances table. Focus on the significance value (Sig.) of the Levene Statistic. If Sig. > 0.05, the homogeneity of variance assumption is met; if Sig. ≤ 0.05, the homogeneity of variance assumption is violated.
  2. Mann-Whitney U test
    NOTE: Since the indicators in this study did not simultaneously meet the assumptions of normality and homogeneity of variance, we applied the Mann-Whitney U test to compare the differences in voice signal feature indicators between the asthma group and the healthy control group.
    1. Navigate to Analyze | Nonparametric Tests | Legacy Dialogs | 2 Independent Samples.
    2. In the dialog box, move the continuous variable (dependent variable) into the Test Variable List field and the grouping variable (categorical variable) into the Grouping Variable field.
    3. Click Define Groups, input the two categories of the grouping variable (e.g., "1" and "2"), and click Continue.
    4. In the main window, select Mann-Whitney U. Ensure that Exact is unchecked (select this option for small sample sizes to improve accuracy). Click Options, select Descriptive, and then click Continue.
    5. Return to the main window and click OK to perform the Mann-Whitney U test.
    6. In the output window, locate the Test Statistics table: the Mann-Whitney U value represents the test statistic. The Asymp. Sig. (2-tailed) value represents the p-value. If p > 0.05, no significant difference exists between the groups; if p ≤ 0.05, a significant difference exists between the groups.
    7. To identify which group has higher measurement values, check the Ranks table, which displays the mean ranks and sample sizes for each group.
  3. Principal component analysis (PCA)
    NOTE: After identifying the differential indicators, we conducted PCA to further analyze the data. PCA is a dimensionality reduction technique that transforms the original data into a few main components to extract important features and simplify the analysis. Prior to PCA, the statistical software automatically standardized the data to eliminate dimensional effects.
    1. Navigate to Analyze | Dimension Reduction | Factor.
    2. In the dialog box, move all variables to be analyzed into the Variables field.
    3. Click the Descriptives button and select KMO and Bartlett's test of sphericity to verify whether the data is suitable for PCA. Click Continue.
    4. In the Extraction tab, set Method to Principal Components, select Scree Plot to determine the number of principal components, and set Extract to Eigenvalues greater than 1. Click Continue.
    5. In the Rotation tab, select None. Click Continue.
    6. In the Scores tab, select Save as variables to save the principal component scores to the dataset.
    7. Return to the main window and click OK to perform PCA.
    8. KMO and Bartlett's Test: A KMO value ≥ 0.6 indicates the data are suitable for PCA. A Bartlett's Test of Sphericity Sig. value < 0.05 indicates significant correlations among variables, making the data suitable for PCA.
    9. Total Variance Explained: Review the eigenvalues and variance explained by each principal component. A cumulative variance explanation rate of 70%-85% is ideal.
    10. Use the scree plot to determine the number of principal components, typically selecting components before the inflection point.
    11. Component Matrix or Rotated Component Matrix: Check the loading coefficients of variables on each principal component. Coefficients > 0.5 are considered significant contributions.

5. Construction of the SVM and RF models

NOTE: The specific methodological framework for constructing SVM and RF models is detailed in Table 3. We have uploaded the SVM and RF models for asthma detection constructed in this study to GitHub (https://github.com/Liteng811/Asthma-Detection). The following will primarily describe how to download and run the code from GitHub.

  1. Clone the GitHub repository.
    1. Open the command line tool and use the following command to clone the repository to the local machine:
      git clone https://github.com/Liteng811/Asthma-Detection.git
      NOTE: This command will download the content of the GitHub repository to the current working directory and create a folder named Asthma-Detection.
  2. Install Python, PyCharm, and Required Python libraries.
    1. Install Python on the machine from the official Python website (https://www.python.org/).
    2. After installing Python, install the necessary Python libraries using the following command: pip install -r requirements.txt.
    3. If there is no requirements.txt file, install the libraries used in this study with the following command:
      pip install numpy pandas scikit-learn matplotlib
    4. Be sure to install PyCharm from the official PyCharm website (https://www.jetbrains.com/pycharm/).
  3. View files in the repository.
    1. In the repository, locate the main script files (SVM.py, RF.py).
    2. Use a text editor or PyCharm to open these Python files and review their contents and structure.
  4. Configure the dataset.
    1. The code in the repository requires data files. Check that the data files have been prepared, and that their format matches the requirements of the code (.xlsx).
    2. There are hardcoded file paths in the code. Modify the paths based on the actual location of the files, that is, replace the paths in the code (e.g., C:\Users\1\Desktop\pca-result.xlsx) with the actual file paths on the system.
  5. Run the code.
    1. After finding the main script, use the following command in the command line to run the code (using SVM.py as an example). If the main script is RF.py, run the corresponding script instead.
      python SVM.py.
    2. When running the code, switch to the correct working directory, or specify the script using its full path in the command line. For example, if running python SVM.py in the command line, either switch to the directory containing SVM.py, or use the absolute path:
      python C:/path/to/your/repository/SVM.py.
    3. During execution, the code will load the data, train the machine learning models (SVM or RF), and output results such as accuracy, confusion matrix, and ROC curve.

Access restricted. Please log in or start a trial to view this content.

Results

Completion of the voice feature index database construction

This study successfully extracted 467 voice feature metrics through a multi-level analysis of voice signals. See the above GitHub URL for 467 voice feature indicators. The analytical methods employed include time-domain analysis, frequency-domain analysis, MFCC extraction, and the transformation of features based on Traditional Chinese Medicine diagnostic standards. Specifically, time-domain analysis reflects the basi...

Access restricted. Please log in or start a trial to view this content.

Discussion

This study explores non-invasive asthma detection methods using voice signal analysis and machine learning techniques. By collecting voice data from 50 asthma patients and 50 healthy controls, this study built models using SVM and RF algorithms16,17,18,19,20. Both models demonstrated comparable performance in terms of the proportion of overall correctly classi...

Access restricted. Please log in or start a trial to view this content.

Disclosures

The authors have no conflicts of interest to declare.

Acknowledgements

This study was supported by the National Natural Science Foundation of China Youth Science Fund Project (Project Approval Number: 82104739) and the Scientific Research Program of the Hebei Provincial Administration of Traditional Chinese Medicine (Project Number: B2025032). The authors would like to thank all the teachers and students who provided assistance during the experiment.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
DeviceSupplierModel/VersionBrand
Digital RecorderZOOM Audio StoreH6ZOOM
GitHubOfficial Website2.47.1.2Git
Matlabhttps://www.mathworks.com/R2024bMathWorks
PycharmOfficial Website2024.1JetBrains
PythonOfficial Website3.12Python

References

  1. Huang, K., et al. risk factors, and management of asthma in China: a national cross-sectional study. Lancet. 394 (10196), 407-418 (2019).
  2. McCormack, M. C., Enright, P. L. Making the diagnosis of asthma. Respir Care. 53 (5), discussion 590-2 583-590 (2008).
  3. Backer, V., et al. Diagnostic work-up in patients with possible asthma referred to a university hospital. Eur Clin RespirJ. 2, (2015).
  4. Fortuna, A. M., Feixas, T., González, M., Casan, P. Diagnostic utility of inflammatory biomarkers in asthma: exhaled nitric oxide and induced sputum eosinophil count. Respir Med. 101 (11), 2416-2421 (2007).
  5. Gibson, P. G. Monitoring the patient with asthma: an evidence-based approach. Allergy Clin Immunol. 106 (1 Pt 1), 17-26 (2000).
  6. Gibson, P. G., et al. Self-management education and regular practitioner review for adults with asthma. Cochrane Database Syst Rev. (1), CD001117(2003).
  7. Dogan, M., Eryuksel, E., Kocak, I., Celikel, T., Sehitoglu, M. A. Subjective and objective evaluation of voice quality in patients with asthma. J Voice. 21 (2), 224-230 (2007).
  8. Ihre, E., Zetterström, O., Ihre, E. B. Voice problems as side effects of inhaled corticosteroids in asthma patients--a prevalence study. J Voice. 18 (3), 403-414 (2004).
  9. Analysis of acoustic features for voice sound based classification of asthmatic and healthy subjects. Yadav, S., Keerthana, M., Gope, D., Uma, M. K., Ghosh, P. K. ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Barcelona, Spain, , 6789-6793 (2020).
  10. Isangula, K. G., Haule, R. J. Leveraging AI and machine learning to develop and evaluate a contextualized user-friendly cough audio classifier for detecting respiratory diseases: Protocol for a diagnostic study in rural Tanzania. JMIR Res Protoc. 13, e54388(2024).
  11. Rogers, H. P., et al. Voice as a biomarker of pediatric health: A scoping review. Children (Basel). 11 (6), 684(2024).
  12. MeLoDicA AI - machine learning based detection of asthma via vocal audio analysis. Looi, Z. Q., Ng, Z. H., Yak, R. X., Rosen, O., Kumar, A. 2024 IEEE Conference on Artificial Intelligence (CAI), , 905-910 (2024).
  13. Barua, P. D., et al. Automated asthma detection in a 1326-subject cohort using a one-dimensional attractive-and-repulsive center-symmetric local binary pattern technique with cough sounds. Neural Comput & Applic. 36, 16857-16871 (2024).
  14. Iqbal, M. D. A., Krishnamoorthy, D., Musthak, S. A. Real time detection and forecasting technique for asthma disease using voice signal and DENN classifier. Biomedical Signal Processing and Control. 76, 103637(2022).
  15. Wu, Y., et al. Ubi-Asthma: Toward ubiquitous asthma detection using the Smartwatch. IEEE Internet of Things Journal. 10 (13), 11576-11587 (2023).
  16. Schölkopf, B., Smola, A. J. Support vector machines. Encyclopedia of Biostatistics. , 978-047197762 (1998).
  17. Burges, C. J. C. A tutorial on support vector machines for pattern recognition. Data Mining and Knowledge Discovery. 2 (2), 121-167 (1998).
  18. Liaw, A., Wiener, M. Random Forest: Classification and Regression. R News. 2 (3), 18-22 (2002).
  19. Cutler, D. R., et al. Random forests for classification in ecology. Ecology. 88 (11), 2783-2792 (2007).
  20. Breiman, L. Random forests. Machine Learning. 45 (1), 5-32 (2001).

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Tags

Voice Feature AnalysisSupport Vector MachineRandom ForestAcoustic SensorsMATLAB AnalysisROC CurveNon-Invasive Diagnosis