An Effective Machine Learning Approach for Classifying Artefact-Free and Distorted Capnogram Segments Using Simple Time-Domain Features

Capnogram signal analysis has received considerable attention owing to its important applications in assessing cardiopulmonary functions. However, the automatic elimination of deformed parts of a capnogram waveform remains an open research problem. Herein, we introduce an automatic classification approach for discriminating artefact-free (regular) and distorted (irregular) segments of capnogram signals. The proposed features include Hjorth parameters and mean absolute deviation (MAD). The main advantage of these features is their simplicity, such that they can be employed in a computationally efficient machine learning algorithm. MATLAB simulation is conducted on 100 regular and 100 irregular segments of capnogram to extract the proposed and existing features, which are ranked based on the Pearson correlation coefficient, ${p}$ -value and area under receiver operating characteristic (ROC) curve. The naive Bayes, decision tree, random forest and support vector machine (SVM) classifiers are fed by the relatively highly ranked features, and the classification performance is assessed via ten-fold cross-validation. Besides the linear kernel SVM, the radial basis function (RBF) and polynomial kernel functions with different orders are also included in the current experiment. Results revealed the effectiveness of the Hjorth activity and MAD attributes when used with the fourth-order polynomial kernel-SVM classifier. The achieved accuracy, precision and specificity are 89%, 92.1%, and 91% outperforming the existing method by 2.5%, 5.6% and 7%, respectively. The simplicity of the proposed time-domain features is confirmed by the average total computational time of features extraction and classification phases which is only 13 ms instead of 19 ms in the case of incorporating both time- and frequency-domain features, indicating a reduction of 31.6%. It is envisaged that the proposed approach can be valuable if implemented with capnography devices for real-time and fully automated capnogram-based respiratory assessment. Even so, further research is recommended to enhance the classification performance through exploring more features and/or classifiers.


I. INTRODUCTION
The human respiratory system consists of linked organs and tissues responsible for taking in oxygen and letting out carbon The associate editor coordinating the review of this manuscript and approving it for publication was Lefei Zhang . dioxide (CO 2 ). Proper functioning of this system ensures that different body parts get the energy they need to carry out different activities [1]. Capnography is widely considered a recommended effort-independent method to monitor respiratory conditions through recording the so-called capnogram signal. This non-invasively recorded capnogram VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ waveform shows the variation of the partial pressure of CO 2 in the flowing air through the nose during inspiration and expiration [2]- [4]. It thereby provides valuable physiologic information about the functioning of the cardiopulmonary system, which is beneficial in airway management. Hence, capnography has been used by physicians in the subjective assessment of lung diseases, such as chronic obstructive pulmonary disease (COPD), congestive heart failure (CHF), asthma and pulmonary edema [5], [6]. Nevertheless, the existing demand for automatic objective assessment of such lifelong respiratory distress conditions has invited researchers to develop computer-aided diagnosis systems for this task [7]- [16]. The primary purpose of these computerized algorithms is to extract and analyze capnogram features with the ultimate goal of controlling life-threatening pulmonary diseases in clinical and home environments. Despite the effectiveness of these capnogram features, they are clinically interpretable and purposeful if and only if quantified from the clean segments of the recorded capnogram signal. Hence, the identification of capnogram segments which are not deformed by artefacts is the first and foremost step in capnogram signal analysis, as pointed up in [17]. We refer to these artefact-free portions as regular capnogram segments in which the different phases of respiration, such as the alveolar plateau phase [3], are clearly defined. On the other side, the irregular capnogram segments are those parts of the CO 2 signal that are distorted by clinical and/or mechanical artefacts [14], [18]. Even though selecting the regular capnogram segments and discarding the irregular ones is an essential prerequisite for capnogram-based lung diseases detection and classification, the automatization of this step using machine learning techniques has not yet received the attention it deserves in the literature. That being the case, the present study is mainly concerned with bridging this research gap.
The rest of the article is organized as follows. Section II discusses the previous related work. Section III presents the material and methods in which the existing and proposed features as well as the employed classifier and features ranking metrics are explained. Section IV includes the results and discussion. Finally, Section V concludes the paper.

II. RELATED WORK
In [7], [8], the authors introduced different time-domain features to discriminate asthmatic and non-asthmatic capnograms. The significant features included Hjorth parameters, particularly mobility and activity, and gradients of expiratory upstroke and plateau phases. However, the selection of regular capnogram segments was performed manually by means of visual scanning. In like manner, this manual cropping of regular capnograms was carried out in other studies [9], [10], which proposed frequency-domain features, such as position and strength of spectral components in addition to linear predictive coding (LPC) coefficients, for capnogram-based asthmatic conditions classification using radial basis function neural network. Also, the capnogram segments with anomalies in their morphology (i.e., irregular segments) were excluded manually in [11], before extracting wavelet-based features for classifying chest oppression and normal breathing cases using support vector machine (SVM). The major problem with this primitive way of visually choosing the regular segments is that it is time-consuming and tedious, making it inappropriate for fully automated capnogram signal analysis over long time intervals. To overcome this issue, template matching and thresholding were alternatively used in [12], [14]. In [12], the authors analyzed the morphological variations of the capnogram signals to distinguish CHF and COPD using quadratic discriminant analysis. Mainly, the employed features were related to the exhalation phase, such as its slope and time duration in addition to end-tidal CO 2 (EtCO 2 ) and the time spent at this signal peak. These features were extracted from the regular capnogram segments selected using the template matching method. In this method, a capnogram segment is labelled as regular or irregular based on its degree of matching with a reference capnogram template. The construction of this template is a challenging task, as it is necessary to involve various shapes of valid breath cycles; otherwise, the reference template may be biased giving rise to misleading results. In [14], the proposed capnogram features for SVM-based asthma classification included the area under certain portions of inspiratory and expiratory capnogram phases. Differing from the template matching method, the authors in [14] checked the regularity of capnogram segments based on comparing statistical parameters, such as standard deviation, with a predefined threshold. In the face of being simple, threshold-based methods in general, have a limitation regarding the hardness of determining the optimal threshold value that can work effectively with unseen data [19], [20]. Other applications of artificial intelligence and machine learning techniques for classifying and predicting different chronic airway diseases can be found in [13], [21], [22].
The aforementioned limitations have given us the motive to introduce a machine learning-based approach recently in [23] for classifying regular and irregular capnogram segments. In this lately proposed approach, the employed features included both time-and frequency-domain features, and the achieved classification performance was limited, especially the specificity that was only 84%. In addition, the SVM classifier was deployed with only the simple linear kernel function [24], [25]. Finding significant yet simple features along with an effective model to classify regular and irregular capnogram segments is apparently a challenging task given that the distortions experienced by capnogram signals have wide morphological variations [18]. In the current work, we propose the mean absolute deviation (MAD) [26] in addition to the Hjorth parameters [27], [28] as features for classifying regular and irregular capnograms. Hereby, we avoided using frequency-domain features which impacted the features computation time and the simplicity of the built classification model. We also included other non-linear SVM kernel functions that can deal with non-linearly separable data conveniently [29]. Furthermore, we used the naive Bayes, decision tree and random forest classifiers [30]- [33] besides the SVM to test the effectiveness of the proposed features with various classification models. In order to assess the performance of the proposed approach, we conducted MATLAB simulation on 100 regular and 100 irregular 15-seconds capnogram segments. The obtained results showed the potential of the currently proposed MAD attribute together with the Hjorth activity when fed to the SVM classifier with the polynomial kernel function.

III. MATERIAL AND METHODS
The block diagram shown in Fig. 1 illustrates the four main stages of the employed methodology, and the following subsections discuss each of these stages.

A. CAPNOGRAM DATA ACQUISITION
Thirty-five subjects consented to participate in this project which is under consideration of National Medical Research Register-Malaysia; research ID 41357. All subjects were adults between 17 and 33 years of age. Each subject was instructed to respire normally for five minutes, after being seated and connected by a nasal cannula to the capnography monitor Capnostream TM 20 Model CS08798. The capnography device acquired capnogram signals, from the participating subjects, at a sampling rate of 20 Hz (i.e., 20 samples/second). Next, cropping of the recorded data was performed with the aim of preparing 100 regular and 100 irregular capnogram segments for our experiment. Each segment comprises 300 CO 2 samples (i.e., the time duration of a capnogram segment is 15 seconds). We chose this length for each segment to make sure that it includes a minimum convenient number of complete breath cycles [23].

B. FEATURES EXTRACTION
Starting from this stage onwards, we used MATLAB (R2015a) as the simulation tool on a computer with an Intel R Core TM i7 processor, 2.5 GHz speed and 16 GB RAM. The amplitude of the incorporated capnogram segments is normalized [34] ahead of features extraction. This normalization step is performed as the main focus, herein, is on classifying regularly-and irregularly-shaped capnograms regardless the actual amplitude values.

1) EXISTING FEATURES
Recently, we proposed in [23] a number of time-and frequency-domain features for classifying regular and irregular capnogram segments. Among these features, the relatively most substantial ones were found to be the area under normalized magnitude frequency spectrum and the signal's variance.
The frequency content (spectrum) of a waveform refers to its constituent sinusoids [35], [36]. The zero-frequency component is insignificant in performing the classification of regular and irregular capnogram segments [23]. Thus, the signal's amplitude is shifted by subtracting the mean value, as given below, to eliminate the zero-frequency component: where the mean value c of an amplitude-normalized capnogram segment 'c(n)' is calculated as: and N is the segment's length (i.e., N = 300). Subsequently, the frequency spectrum of 'x(n)' is calculated using the discrete Fourier transform as follows [35], [36]: where the whole number 'k' is related to the signal's frequency 'f ' and sampling frequency 'f s ' as given below: The normalized magnitude frequency spectrum, in which the magnitude of any frequency component ranges from VOLUME 10, 2022 0 to 1 is then used to compute frequency-domain features. According to the reported findings in [23], the area under normalized magnitude spectrum is a more relevant feature than the number of relatively high spectral peaks for distinguishing regular and irregular capnogram segments. Therefore, in this work, we chose this feature which is calculated as follows: where the subscript 2 denotes the upper frequency bound, in hertz, for which the area is computed. That is, the lower and upper limits of 'k' are 0 and 2(N /f s ), respectively, because the frequency band 0 ≤ f ≤ 2 Hz contains the major portion of the capnogram signal power [23]. The variance of 'c(n)' is calculated by squaring the standard deviation as given below [35], [37]: The variance (also referred to as Hjorth activity [27], [28]) measures the signal's variability about its average value. A relatively large variance indicates a wide spread of the signal's amplitude around the mean value, while the opposite is indicated by a small variance [37].

2) PROPOSED FEATURES
Together with the lately proposed features, here we propose the Hjorth mobility and complexity parameters [27], [28] in addition to the MAD as features for enhancing the performance of regular/irregular capnogram classification. The Hjorth mobility parameter is defined as the reciprocal ratio between the standard deviations of the signal and its first derivative [27], [28]: where c (n), the first derivative of a capnogram segment, is computed as follows [38]: and T s is the sampling time interval: The Hjorth mobility parameter gives an indication of the standard deviation of the signal's power spectrum over the entire frequency range [27], [28]. That is to say, a signal with focused frequency content in a narrow range has a lower mobility than that of another signal with a widely spread power spectrum. The Hjorth complexity parameter is computed by dividing the signal's first derivative's mobility by the signal's mobility [27], [28]: and thereby, where c (n), the second derivative of a capnogram segment, is computed in a way analogous to (8) [38]: The Hjorth complexity is a dimensionless parameter which indicates the similarity between the signal's morphology and that of a sinusoidal waveform [27]. The complexity value converges to one as the signal's shape gets more like a pure sine wave. In other words, the minimum signal's Hjorth complexity value is one which is obtained in the case of a pure sine wave [27], [28]. The MAD evaluates the average absolute difference between CO 2 samples and the mean CO 2 value of the entire capnogram segment [26], as given below: The power of a signal, such as a capnogram segment, is proportional to the average absolute deviation of its amplitude from the mean amplitude. Hence, the signal's MAD serves as an index of its power [39]. This means that a wide signal swing causes the signal's power and MAD value to be higher than those of a signal whose amplitude variation is narrow around the mean.

C. FEATURES EVALUATION AND SELECTION
In this work, we made use of the Pearson correlation coefficient, receiver operating characteristic (ROC) curve and p-value to evaluate the relevance of the extracted features [40]- [46]. The Pearson correlation coefficient 'ρ', which indicates the linear relationship between a feature F j = [f j1 , f j2 , . . . , f jM ] and target class labels L = [l 1 , l 2 , . . . , l M ], is defined as their covariance divided by the square root of the product of their variances as given below [40], [41], [47]: That is, where the mean values F j and L of F j and L, respectively, are calculated as: and M represents the number of capnogram segments that are used in our experiment (i.e., M = 200). The range of the Pearson correlation coefficient is as follows [40], [41]: The larger the value of ρ(F j , L) , the more the efficacy of the j th feature [47], [48]. That is, features with high correlation values (close to '1') contribute more towards performing accurate classification than those features with low correlation values (close to '0'). Similar to what is reported in [49], we categorized the relevance of the extracted features based on the associated Pearson correlation coefficients as follows: Besides the Pearson correlation coefficient, the ROC curve is another tool for assessing the effectiveness of features. Particularly, the area under the ROC curve (AUC) is reported as a reliable features ranking metric [43], [44]. This features ranking method is referred to as feature assessment by sliding thresholds (FAST) [44]. FAST considers each individual feature as the input of a single feature classifier that performs the classification based on a decision threshold. At any arbitrary decision threshold, true and false positives in addition to true and false negatives are counted according to the confusion matrix shown in Table 1 [42]. By sliding the decision threshold, the true positive rate (TPR) and false positive rate (FPR), at each decision threshold, are calculated as follows [42], [44]: Hence, the obtained TPR and FPR values are used as y-and x-coordinates, respectively, to build the ROC curve for each individual feature. Subsequently, the AUC values (that range from '0.5' to '1' [44]) are found for all extracted features.
In this work, we used the trapezoidal rule for computing the AUC [50]. It can be inferred from (19) and (20) that the optimum TPR and FPR values are '1' and '0', respectively. Thus, the larger the AUC value, the more relevant is the feature [43], [44].
In addition to Pearson correlation coefficient and AUC, we also employed the probability-value (known as p-value [45]) to examine the feasibility of the proposed features. For each feature, the p-value helps determine whether to accept or reject the so-called null hypothesis that assumes no significant difference between classes. In other words, the p-value indicates the statistical significance of interrelationship between classes for an individual feature [45], [46]. If the p-value is below a pre-determined significance level (usually 5 × 10 −2 [45], [46]), the null hypothesis is rejected and accordingly the feature is considered acceptable in the context of differentiating both classes.
Based on the aforementioned features ranking metrics, the relatively least relevant features are eliminated by using the filter-based feature selection method [47], [51].

D. CLASSIFICATION AND PERFORMANCE EVALUATION
Herein, we employed the SVM classifier to discriminate between regular and irregular capnogram segments. The SVM is a popular supervised machine learning method that uses hyperplanes to distinguish between different classes [24], [25]. The main idea of constructing a SVM classification model is based on choosing a separating hyperplane (i.e., decision boundary) that is located in between and as far as possible from the data points of both classes. For linearly separable data, it is convenient to use the linear SVM that employs a linear decision hyperplane. On the other hand, the non-linear SVM is recommended for classifying non-linearly separable data. The non-linear SVM uses a kernel function with the aim of transforming the input data into a higher-dimensional feature space in which data points of the two classes are linearly separable [52]. Besides the SVM, we also deployed the naive Bayes, decision tree and random forest classifiers [30]- [33]. The naive Bayes classifier is built, during the learning process, by constructing a Bayesian probabilistic model that aims to assign a posterior class probability to a sample capnogram segment, and hence classification is performed [30]. On the other hand, the basic strategy of the decision tree depends on classifying an unknown data sample by using one or more decision functions in a hierarchical manner. This is carried out through a number of computations performed at the set of nodes and branches of the decision tree that is constructed in the learning phase [31]. Despite its simplicity, a main drawback of the decision tree classifier is the propagation of the error that may occur in a node close to the root. This disadvantage is avoided by the random forest, which performs the classification through an ensemble of decision trees [32], [33].
In this study, we trained and tested SVM classification models with linear, radial basis function (RBF) and polynomial kernel functions [29], [53] in addition to the naive Bayes, decision tree and random forest classifiers. For m selected features, 90% and 10% of the data set l 2 ), . . . , (f iN , l N )} are used for training and testing the classifier model, respectively, where i ∈ {1, 2, . . . , m}. Training and testing are repeated through performing ten-fold cross-validation [25]. The results of the testing phase are used to compare the classifier's decisions with the ground truth and find the components of the confusion matrix (See Table 1). This is to assess the classification performance of each model based on (19) and (20) in addition to the following evaluation metrics [42]: where the accuracy indicates the proportion of correct classifier's detections to all tested capnogram segments, while the precision represents the fraction of classifier's positive predictions that actually belongs to regular capnogram segments [23]. Sensitivity is the same as the TPR, and specificity is the complement of the FPR referring to the proportion of the irregular capnogram segments that are successfully identified by the classifier.

A. FEATURES ANALYSIS
We computed and evaluated the existing and proposed features, described in the methodology section, for all capnogram segments in the employed dataset. Figures  2 and 3 show sample regular and irregular capnogram segments, respectively, and their magnitude frequency spectrum. Table 2 lists the mean ± standard deviation of the previously and currently proposed features in addition to the corresponding features ranking metrics. The ROC curves for all extracted features are plotted in Fig. 4. Overall, the results revealed that the relatively most relevant and powerful features are the MAD, Hjorth activity and area under normalized magnitude frequency spectrum. On the flip side, the relatively least relevant features are the Hjorth mobility and complexity. As depicted in Fig. 2, the single significant spectral peak reflects the consistent periodic pattern of the regular capnogram segment. Particularly, this peak is observed at 0.2 Hz which indicates the approximate time duration of one breath cycle (i.e., 1/0.2 Hz = 5 s) for this sample segment. On the other side, more significant peaks at relatively higher frequencies are observed in the spectrum of the irregular capnogram segment (See Fig. 3) due to the chaotic signal's amplitude. Hence, as shown in Table 2, lower values of area under normalized magnitude spectrum were obtained for regular capnogram segments (0.2534 ± 0.0569), compared to those of irregular segments (0.3745 ± 0.09). Besides, the existence of more significant harmonics in the irregular capnogram segment's frequency spectrum is expressed by  a relatively higher Hjorth mobility parameter (3.1256 ± 0.5164) compared with that of a regular segment (2.7556 ± 0.3996) which usually has a focused frequency spectrum. In consistency with the findings reported in [23], the area under the normalized magnitude spectrum is considered a moderately relevant feature according to its Pearson correlation value which is 0.6285. In addition, the feature's AUC is 0.8634 and the p-value is as low as 2.2 × 10 −23 which shows that the distinction between both classes, based on this feature, is statistically significant. For the Hjorth mobility, although the p-value is below 5 × 10 −2 , a low Pearson correlation of 0.3735 is exhibited by this feature which suggests that it is a weakly relevant feature. This is also confirmed by the AUC, which is only 0.6988, indicating that achieving low FPR and high TPR simultaneously is not possible using the Hjorth mobility attribute (See Fig. 4). The  weak relevance of the Hjorth mobility is seemingly due to the erratic width of the frequency spectrum of irregular segments, which depends on the degree of random variations of the CO 2 signal level. That is, some irregular segments have higher Hjorth mobility because of their broader frequency spectrum, while other segments have lower mobility values like those of regular segments whose frequency spectrum is focused within a narrow range.
Contrary to irregular capnogram segments, the different phases of a regular segment are clearly defined in accordance with the description of the typical capnogram signal's morphology [3]. In other words, the signal's amplitude of regular segments is consistently fluctuating and the dead space lasts for a shorter period than that of other phases in which the CO 2 samples have higher values (See Fig. 2) [3], [23]. This leads to an increased signal power, which justifies the higher Hjorth activity and MAD values exhibited by most regular capnograms compared with irregular ones. In particular, as listed in Table 2 Fig. 4 and Table 2.
The Hjorth complexity feature is employed, in this work, to reflect the oscillations in the CO 2 signal level and consequently distinguish between regular and irregular capnogram segments. However, the obtained complexity values for regular and irregular capnogram segments are 4.9196 ± 0.8863 and 4.8892 ± 1.0566, respectively, which shows that the two groups are highly overlapped. This implies that the difference between the two classes, with respect to this feature, is not statistically significant (p-value > 5 × 10 −2 , as shown in Table 2). Moreover, the feature's AUC and Pearson correlation are only 0.5334 and 0.0157, respectively, thereby indicating that it is an extremely weakly relevant feature. Hence, the Hjorth complexity is not a significant feature for the task of discriminating regular and irregular capnogram segments. One possible reason is that both the systematized and inconsistent amplitude's fluctuations of regular and irregular segments, respectively, do not resemble the sinusoidal signal, and therefore the complexity values for both classes were found to be approximately five times the complexity value of a pure sine wave.

B. CLASSIFICATION PERFORMANCE ANALYSIS
In order to exclude the least powerful features, we employed the filter-based feature selection method [47] by setting a filtering threshold of ρ(F j , L) = 0.5. Accordingly, the Hjorth mobility and complexity parameters were ruled out and the remaining highly-ranked features were grouped together in feature set A, as illustrated in Table 3, to be utilized in the classification stage. Besides, other feature sets B, C and D, which comprise all pairwise combinations of the three features in set A, were investigated for the purpose of achieving the best possible classification performance using a lower-dimension feature space. This aimed at minimizing the computational time of features extraction in addition to building a less complex classification model. By using each feature set, the SVM with linear, RBF and fourth-order polynomial kernel functions, was trained and tested via ten-fold cross-validation [25]. The detailed classification performance results are listed in Table 3.
Unlike manual selection, template matching and threshold-based methods utilized in [7]- [12], [14], the classification of regular and irregular capnogram segments was performed lately in [23] by using a machine learning-based approach in which the two features included in set B (i.e., area under normalized magnitude spectrum and Hjorth activity) have been employed with the linear SVM classifier. The current results showed that using non-linear kernel functions with the same feature set B did not offer a notable improvement over the reported results in [23], as shown in Table 3. For instance, the FPR is still quite high ranging between 15% and 18%. Additionally, the accuracy, TPR and precision are all below 90%. This limited performance is likely due to the overlap between the two classes in the feature space formed by the components of set B, as highlighted in [23]. Whereas, when the area under normalized magnitude spectrum is used along with the proposed MAD attribute (i.e., feature set C), a relatively better classification performance was obtained, especially in terms of the TPR that reached 92% in the case of using the RBF kernel function. This positive impact of involving the MAD is consistent with being the feature that exhibited the highest AUC value of 0.9558 (See Table 2 and Fig. 4). A more enhanced performance was observed when feature sets A and D were employed with the fourth-order polynomial kernel function. However, feature set D has the advantage of including a reduced number of features compared to set A. Furthermore, both Hjorth activity and MAD; the members of feature set D, are time-domain features which implies that the required processing time for transforming the capnogram signal into the frequency-domain will be saved. In other words, making use of the proposed MAD feature rather than the area under normalized magnitude spectrum in performing regular/irregular capnogram segment classification will contribute to building a more computationally efficient system.
We further investigated the efficacy of the proposed features by feeding them into three different classifiers other than the SVM. Table 4 shows the classification performance of these classifiers; naive Bayes, decision tree and random forest, when each of the four feature sets was employed. By comparing the results obtained when feature sets A and D were employed, it is reassured that the extraction of the traditional area under normalized magnitude spectrum feature, which necessitates transforming the capnogram signal into the frequency-domain, can be avoided while maintaining almost the same classification performance. The results also confirmed the feasibility of the MAD and Hjorth activity features through achieving the relatively best accuracy (87%) when these features were fed to the decision tree and random forest classifiers. Furthermore, among the three classifiers, the random forest classifier provided the least FPR (11%) and the highest precision (90.45%). The largest TPR (93%) was observed when the naive Bayes classifier was fed by any of the four feature sets. However, we do not recommend this classifier as it showed a poor FPR with all the feature sets; that is, the lowest FPR was as high as 19% in the case of using feature set C. Moreover, the achieved precision was always below 85% regardless of the employed features, as shown in Table 4. Although the overall performance of the random forest classifier is better than that provided by the naive Bayes and decision tree classifiers, the SVM with fourth-order polynomial kernel function is still comparatively superior (See Table 3). Additionally, the SVM would be more convenient and strongly preferred over other classifiers if the number of features and/or data samples is increased, as highlighted in [54].
In order to justify the reason behind choosing the polynomial kernel function of order four, we investigated the SVM classification performance when different polynomial orders are employed with feature set D. The results are listed in Table 5 and illustrated graphically in Fig. 5. For higher polynomial orders, a better performance was observed because the constructed non-linear decision boundary is more appropriate for separating the non-linearly separable data of the two classes. However, increasing the polynomial order above four caused a performance degradation due to the over fitting problem which makes the built classification model unable to deal properly with unseen data [55]. The highest accuracy (89%) and precision (92.1%) were achieved by using the fourth-order polynomial. Although the relatively highest TPR (89%) was provided by the first and second orders, the least FPR (9%) was obtained when the third-, fourth-and fifth-order polynomials were used. Achieving a low FPR is more crucial than a high TPR, in this study, because misclassifying a distorted capnogram segment as a regular one may lead to misleading results in the capnogram-based cardiopulmonary assessment which is not the case when some regular capnogram segments are falsely discarded. Therefore, the obtained results revealed that the  fourth-order polynomial kernel function is recommended for the current classification task. Table 6 summarizes the best classification performance achieved by each of the deployed classification models with the presented features in this study. Among these classifiers, the best performance in terms of accuracy, specificity and precision was provided by the SVM with the fourth-order polynomial kernel function. In addition, the trained SVM model performed the classification of a capnogram segment within only 1 ms on average, which is the least classification time compared to that of the random forest, decision tree and naive Bayes classifiers, as shown in Table 6. The naive Bayes classifier outperformed the other classifiers only in terms of sensitivity, achieving 93%, at the expense of spending a longer classification time five times that of the SVM. Furthermore, obtaining this relatively high sensitivity required the employment of a frequency-domain feature instead of the Hjorth activity, which extended the time taken for features extraction to be 18 ms rather than 12 ms. Table 6 also highlights the achieved performance enhancement in the current work through a comparison against the lately reported results in [23]. Herein, we suggested extracting simple time-domain features from a capnogram segment, requiring less computational time. In particular, the average computational time for features extraction and classification per segment is considerably reduced by 31.6% compared to incorporating both time-and frequency-domain features (13 ms instead of 19 ms). Moreover, the accuracy and precision were increased from 86.5% each to 89% and 92.1%, respectively, indicating a more accurate discrimination between regular and irregular capnogram segments. Further, employing the proposed MAD feature along with the Hjorth activity could yield a specificity of 91% which is 7% higher than the existing approach in [23]. Nevertheless, these improvements were achieved at the expense of the classification sensitivity that decreased by 2%. Additionally, the proposed SVM-based classification method employed the fourth-order polynomial kernel function, which is relatively more complex than the simple linear kernel function used in [23], affecting the classifier's training time.

V. CONCLUSION
The objective of this study was to present a powerful classification approach for the discrimination of regular and irregular capnogram segments using simple features. For this purpose, we employed the SVM, naive Bayes, decision tree and random forest classifiers along with the Hjorth parameters and MAD features. Based on our results, we conclude that the relatively highly ranked features; Hjorth activity and MAD, are capable of achieving the objective when fed to the SVM classifier with fourth-order polynomial kernel function via ten-fold cross validation. In particular, the achieved classification accuracy, precision and specificity by the proposed approach are 89%, 92.1% and 91%, outperforming the lately reported results by 2.5%, 5.6% and 7%, respectively. Moreover, using only time-domain features rather than involving both time-and frequency-domain features contributed to reducing the total computational time of features extraction and classification substantially by 31.6%. Thereby, the propriety of deploying the proposed methodology in real-time capnogram signal analysis is assured. Despite the potential of the presented approach, the sensitivity is slightly decreased by 2%. Looking forward, further research is advocated to enhance the classification performance through exploring more features and/or classifiers. ISMAIL M. EL-BADAWY received the B.S. and M.S. degrees in electronics and communications engineering from the Arab Academy for Science and Technology, Cairo, Egypt, in 2009 and 2014, respectively. He is currently pursuing the Ph.D. degree in electrical engineering with the Universiti Teknologi Malaysia, Johor, Malaysia. Since 2014, he has been working as an Assistant Lecturer at the Arab Academy for Science and Technology. He is also on a leave to pursue the Ph.D. degree in electrical engineering at Universiti Teknologi Malaysia. He participated in a number of IEEE conferences, such as the IEEE Global Conference on Signal and Information Processing (GlobalSIP) and the IEEE International Conference on Signal and Image Processing Applications (ICSIPA). He has authored or coauthored different conference papers and journal articles which are indexed in Scopus and Web of Science. His research interests include bioinformatics and biomedical signal processing. He is a member of the Asia-Pacific Signal and Information Processing Association (APSIPA).
ZAID OMAR (Senior Member, IEEE) received the master's degree in data communications from The University of Sheffield, and the Ph.D. degree in electrical engineering from Imperial College London, in 2012. He has industrial experience as an Electronic Engineer with AISB and a Firmware Engineer with IBS Technology, Kuala Lumpur. He is currently a Senior Lecturer at the Universiti Teknologi Malaysia. His research interests include computer vision, medical imaging, and image fusion.
OM PRAKASH SINGH received the bachelor's degree in science (physics, chemistry, and math), the master's degree in physics, the master's degree in biomedical engineering, and the Ph.D. degree in biomedical engineering, in 2005,2007,2009, and 2019, respectively. Besides, he worked as Postdoctoral Research Associate in medical device engineering at The University of Edinburgh, Edinburgh, U.K. Additionally, he has six years of teaching experience and four years of research experience. He is currently working as a Researcher with the Group of Circuits and Systems, Tyndall National Institute, University College Cork, Cork, Ireland. He has also filed one IP and obtained two copyrights for his research work. To date, he has authored or coauthored around 27 researched and reviewed manuscripts. His research interests include the development of handy medical devices using optical-based sensors, by deploying signalprocessing algorithms, and machine learning techniques for the automatic classification of cardiopulmonary conditions. He has been awarded two gold awards and one merit award for his research.