*3.2. Wavelet Basis Comparison and Selection*

After the classifier is determined, the model order *nDSSM* and wavelet basis *ωDSSM* should be further confirmed through the grid search method. This process can be seen in the step 1 of the Figure 2. The candidate wavelets include db1, db2, db3, db4, db5, db6, db8, db16, db32, sym2, sym8, sym16, coif1, coif3 and dmey. The candidate model order is 5 to 10. The Following Tables 6–14 are the experiments results of the DRMS database without LEFs, in which the highest accuracy values are highlighted in bold.

**Figure 2.** The diagram of the parameter optimization process.

**Table 6.** The accuracy (%) of the two class sleep stage classification with different wavelet bases and different order of DSSM under R&K standard. Only DSSMFs are used, no LEFs.


**Table 7.** The accuracy (%) of three class sleep stage classification with different wavelet bases and different order of DSSM under R&K standard. Only DSSMFs are used, no LEFs.


**Table 8.** The accuracy (%) of four class sleep stage classification with different wavelet bases and different order of DSSM under R&K standard. Only DSSMFs are used, no LEFs.



**Table 9.** The accuracy (%) of five class sleep stage classification with different wavelet bases and different order of DSSM under R&K standard. Only DSSMFs are used, no LEFs.

**Table 10.** The accuracy (%) of six class sleep stage classification with different wavelet bases and different order of DSSM under R&K standard. Only DSSMFs are used, no LEFs.


From Tables 6–10, we can see that under the R&K standard, when the order of the DSSM is 6 and the wavelet basis is selected as db1, the classification accuracy for three to six classes can reach the highest. When the wavelet basis is selected as sym2, the accuracy of the two classes is the highest. Through further analysis, it can be seen that in the results of two class classification, the difference between the accuracy of the db1 and the highest is very small.

**Table 11.** The accuracy (%) of two class sleep stage classification with different wavelet bases and different order of DSSM under AASM standard. Only DSSMFs are used, no LEFs.


**Table 12.** The accuracy (%) of three class sleep stage classification with different wavelet bases and different order of DSSM under AASM standard. Only DSSMFs are used, no LEFs.



**Table 13.** The accuracy (%) of four class sleep stage classification with different wavelet bases and different order of DSSM under AASM standard. Only DSSMFs are used, no LEFs.

**Table 14.** The accuracy (%) of five class sleep stage classification with different wavelet bases and different order of DSSM under AASM standard. Only DSSMFs are used, no LEFs.


As can be seen from Tables 11–14, when the order *nDSSM* is 6, the highest classification accuracy can be obtained in two to five classes sleep state classification. Moreover, in the three to five classes classifications, when the wavelet basis is db1, the highest classification accuracy can be achieved. In the two classes of sleep classification, when the wavelet base is db1, the accuracy is 0.14% lower than the highest accuracy. Combining the classification results of the above tables, in order to facilitate subsequent calculations, the db1 was uniformly used as the wavelet basis for DSSM estimation and the model order of DSSM adopts 6.

Then, the wavelet basis *ωLE* and level *lLE* which are required to calculate LE should be further determined according to the experimental results in the next step. That is, on the basis of the features previously extracted from the DSSM, LEFs will be added which have been shown in the Step 2 of the Figure 2. Tables 15–19 are the classification accuracies of 2–6 classes under the R&K standard, in which the highest accuracy values are highlighted in bold.

**Table 15.** The accuracy (%) of two class sleep stage classification with different *ωLE* and *lLE* under R&K standard.


**Table 16.** The accuracy (%) of three class sleep stage classification with different *ωLE* and *lLE* under R&K standard.


**Table 17.** The accuracy (%) of four class sleep stage classification with different *ωLE* and *lLE* under R&K standard.


**Table 18.** The accuracy (%) of five class sleep stage classification with different *ωLE* and *lLE* under R&K standard.


**Table 19.** The accuracy (%) of six class sleep stage classification with different *ωLE* and *lLE* under R&K standard.


As can be seen from Tables 15–19, when *lLE* = 5, the *ωLE* is db4, the accuracy of two, four and six classes is the highest. Moreover, when the *ωLE* is set to the db5 and db3, the classification accuracy of three and five classes can reach the highest respectively. The Table 20 is the confusion matrix of six classes sleep state classification on DRMS database with IMBEFs under the R&K standard. As shown in the Table 20, the sensitivity of Awa, REM, S1, S2, S3 and S4 are 93.68%, 81.16%, 14.37%, 89.29%, 25.71% and 77.99%, respectively. Moreover, the overall accuracy of the six classes classification is 78.92%.

**Table 20.** The confusion matrix of six classes sleep state classification on DRMS database under the R&K standard. The *lLE* = 5, *ωLE* = *db*4, *nDSSM* = 6, *ωDSSM* = *db*1.


Tables 21–24 show the classification accuracy of 2–5 classes with LEFs on the DRMS database under the AASM, in which the highest accuracy values are highlighted in boldface. As can be seen from these tables, after adding LEFs, the accuracy of each classification has been greatly improved. Among them, the highest accuracy can be obtained when using the LEFs extracted from the 5 level

WPD and there are three corresponding wavelet bases, which are db1, db2 and db4. When the wavelet basis is selected as db4, the accuracy of two classes and four classes can reach the highest. In addition, the accuracy of three and five classes are 88.22% and 79.90% respectively, which is not much different from 88.26% and 79.97% of the corresponding highest classification accuracy. Therefore, the parameter of *lLE* will be set as 5 and *ωLE* will be set as db4 in this paper.

**Table 21.** The accuracy (%) of two class sleep stage classification with different *ωLE* and *lLE* under AASM standard.


**Table 22.** The accuracy (%) of three class sleep stage classification with different *ωLE* and *lLE* under AASM standard.


**Table 23.** The accuracy (%) of four class sleep stage classification with different *ωLE* and *lLE* under AASM standard.


**Table 24.** The accuracy (%) of five class sleep stage classification with different *ωLE* and *lLE* under AASM standard.


The confusion matrix of five classes sleep state classification is listed in the Table 25. As can be seen in this table, the overall accuracy is 79.90%. The sensitivity of Awa, REM, N1, N2, N3 are 92.89%, 81.22%, 17.57%, 85.52% and 78.79%. Furthermore, the receiver operating characteristic (ROC) curve of the classifier trained by this dataset with the confirmed parameter is shown in Figure 3.

As can be seen in the Figure 3, when the positive samples is Awa, the true positive rate is 0.93 and the false positive rate is 0.05. In addition, when the positive samples are REM, N2 and N3, the corresponding positive sample rates are 0.81, 0.86 and 0.79. When the positive samples are N1, the area under the curve (AUC) area is only 0.18. Moreover, the issue of low classification accuracy of S1(N1) will be discussed in the Section 4.

**Table 25.** The confusion matrix of five classes sleep state classification on DRMS database under the AASM standard. The *lLE* = 5, *ωLE* = *db*4, *nDSSM* = 6, *ωDSSM* = *db*1.

**Figure 3.** The ROC curve of the classifier to classify the five classes of DRMS database under the AASM standard.
