## 3 Results
### Algorithm for the Respiratory Monitoring System and Its Application  
Based on a comprehensive understanding of the characteristics of respiratory signals, the decision tree model algorithm is a powerful tool for automatically detecting and classifying complex respiratory behaviors. It has the advantage of reducing over-fitting problems and ranking the importance of extracted features in classification. This makes it an ideal choice for wearable healthcare applications, as it can provide high recognition accuracy. Figure 4a shows the detailed workflow for the decision tree model algorithm. In the training stage, five classification feature sets are first established based on the extraction of  
Figure 3: Data analysis and feature extraction of five typical respiratory behaviors. (**a–e**) Real-time output voltage curves generated by triboelectric respiratory sensors for normal breathing, deep breathing, sneezing, coughing, and laughing. (**f–j**) The time—frequency spectra corresponding to the five output voltage curves analyzed by wavelet transform. (**k–o**) The corresponding energy distributions of output voltage curves analyzed by Fourier transform. the above 12 features for each type of respiratory behavior. The structure and flow of the training data set are shown in Figure S9. Using these five classification feature sets and the corresponding annotation labels, we achieved the trained classification model based on the decision tree algorithm. In the test stage, the features of the unknown respiratory signals were extracted and classified one by one according to the trained classification model, until all the features were matched. In this work, the number of training data samples for the five types of respiratory signals was 1580. Figure 4b shows the Gini importance indexes of the 12 features in the trained classification model, which are often used to feedback the importance of each feature and judge the contribution in the classification model. It can be seen that variance, root mean square, kurtosis, and unbiased estimation are the most important indicators of the classification model, while coefficient of variance, edge factor, waveform factor, and peak factor contribute less to respiratory behavior classification. We randomly selected 149 normal breathing samples, 77 deep breathing samples, 64 coughing samples, 76 sneezing samples, and 29 laughing samples as a test data set to test the recognition accuracy after training (Figure S10). Such a test method for data extraction is more random and can highlight the accuracy of decision tree model classification. As shown in Figure 4c, a 3D scatter diagram is provided to intuitively highlight the classification ability of the algorithm with respect to the test data set. The signals of sneezing (green) and coughing (red) are  
Figure 4: Demonstrations of the wireless and real-time respiratory monitoring system. (**a**) The workflow chart of respiratory type recognition based on the decision tree algorithm includes data acquisition, preliminary processing, the algorithm learning process, and the algorithm testing process. (**b**) Gini importance indexes of 12 features in the classification model trained on the 1580 data samples. (**c**) A 3D scatter diagram with average value, variance, and skewness as the features selected in the coordinate axes to divide five respiratory types. (**d**,**e**) Confusion matrix and classification accuracy of the recognition of five respiratory types. (**f**) Optical photograph of the wireless intelligent respiratory monitoring system and a mobile phone app made for real-time respiratory recognition and statistics. usually difficult to distinguish in waveforms. Here, they can be clearly distinguished by only three selected features, namely, average value, variance, and skewness. According to the confusion matrix, the average accuracy for recognizing respiratory types reached up to 97.2%, indicating the huge potential in terms of meeting daily respiratory monitoring requirements (Figure 4d,e).