# A Domain-Based, Adaptive, Multi-Scale, Inter-Subject Sleep Stage Classification Network
## 3 Experiments
### Results  
We tested different deep learning models in two modes, namely, inner-subject and inter-subject, to verify the domain differences in subjects. Inner-subject mode means that the dataset is divided into the training set and the test set according to the samples. This means that the samples in the test set and the samples in the training set may come from the same subject. Inter-subject mode means that the dataset is divided into the training set and the test set according to the subjects--that is, the samples in the test set cannot be from the same person as the samples in the training set. Table 2 shows the comparison results of three different feature encoders under the two types of modes on three datasets, with a CNN block with bidirectional GRU (Bi-GRU), the residual module with Bi-GRU, and the multi-scale residual model with Bi-GRU. The result shows that the performance of different models on the training set tends to be the same as the performance on the test set under the inner-subject mode. Specifically, the average accuracy and the average Kappa on the test set of the three datasets are at the same level as the training set. However, in the inter-subject mode, the performance on the training set and the test set under different models is significantly different. Specifically, the evaluation results are reduced on the test set. Compared with the training set, the average rate dropped by 15%, and the average Kappa dropped by 0.25. As shown in Figure 5, the overall features of the test set before DA are different compared with the overall features of the training set, which is reflected in the features' confusion among classes before DA, so this causes the classifier to not distinguish the classes well. The comparison results of the multi-scale residual module with Bi-GRU proposed in this paper on the test sets of the three datasets before and after introducing DA are shown in Table 3. The result shows that there is a significant improvement in the generalization of the model through fine-tuning and DA. Taking SHHS2 as an example, the overall distribution of the test set after DA tends to reflect the overall distribution of the training set, and the classes are more distinguishable, as shown in Figure 5. The domain loss combined with the multi-class focal loss could solve the problem of data imbalance. Meanwhile, the distribution of inter-class features is more discriminative, and the distribution of intra-class features is more concentrated. We compare the method proposed in the paper with other methods referring to the review of sleep staging based on ECGs [40,41]. The results are shown in Table 4. The proposed method achieves a state-of-the-art solution for sleep staging, which is only sensed through ECG signals. In particular, the proposed method shows a great improvement in the precision of REM and deep sleep compared with other methods. Moreover, the performance of the proposed multi-scale residual module also exceeds that of other feature encoder structures, as shown in Table 5. From the performance of the three datasets on the three different residual module models, the test set of SHHS2 obtains the best evaluation of the residual model with a kernel size of 21, and SHHS1 and