# Non-Intrusive Load Disaggregation Based on a Multi-Scale Attention Residual Network
## 4 Result
Combined with Figure 7 and Table 1, it can be inferred that the shallow CNN s-s and CNN s-p have difficulty accurately disaggregating the total power into the appliances with lower frequency. Compared with KNN and MSA-Resnet, the disaggregation errors of CNN s-s and CNN s-p are larger, because the structure of shallow CNNs is not able to extract deeper and more effective load characteristics, and their disaggregation effect is not as good as that of MSA-Resnet. There are two reasons for this: firstly, the residual is used to deepen the network and better enhance the ability to learn unbalanced samples; secondly, the ability to deal with low frequency appliances by multi-scale convolutions is strong. As can be seen in Figure 7, the overall disaggregation effect of the KNN on the washing machine is not good, but the disaggregation error is small in terms of two indicators. To explain this phenomenon, certain interval periods are selected for comparative analysis, as shown in Figure 8, the disaggregation comparison diagram shows each algorithm on each electrical appliance with a finer scale. The figure reflects the ability of the KNN to detect peak values. It can be seen in Figure 8b,c that the KNN is not able to accurately disaggregate mutation points, but it could process regions with a power close to 0. Figure 8: Load disaggregation comparison for Household 25 of the WikiEnergy dataset. After the disaggregation of load, power thresholds of electrical appliances were used to distinguish the on/off states, so as to calculate their evaluation indexes. The thresholds of the air conditioner, fridge, microwave, washing machine, and dishwasher were set to 100 W, 50 W, 200 W, 20 W, and 100 W, respectively. _Recall_ rate, _precision_ rate, _accuracy_ rate, and \(F1\) values [41] were used to further evaluate the performance of the different algorithms in their on/off states. _Recall_ represents the probability of predicting correctly in the instance with a positive label:  
\[Recall=\frac{TP}{TP+FN}, \tag{15}\]  
where True Positive (\(TP\)) represents the number of predicted states that are disaggregated as \"on\" when their ground truth state is \"on\", and False Negative (\(FN\)) denotes the number of predicted states that are \"on\" when their ground truth state is \"off\". There are two possibilites: one is to predict the original positive class as a positive class (\(TP\)), and the other is to predict the original positive class as a negative class (\(FN\)). _Precision_ refers to the proportion of samples that are predicted to be in an \"on\" state and are indeed in an \"on\" state:  
\[Precision=\frac{TP}{TP+FP}, \tag{16}\]  
where False Positive (\(FP\)) represents the number of states that are actually \"off\" when their predicted states are \"on\". _Accuracy_ refers to the ratio of the number of samples correctly predicted to the number of the total dataset:  
\[Accuracy=\frac{TP+TN}{P+N}, \tag{17}\]  
where \(P\) is the number of positive samples, and \(N\) is the number of negative samples. \(F1\) can be expressed as  
\[F1=2\times\frac{precision\times recall}{precision+recall}. \tag{18}\]  
Table 2 is a comparison of the evaluation indexes for judging \"on\" or \"off\" states of Household 25 electrical appliances. It can be seen from Table 2 that for _Accuracy_ and \(F1\), MSA-Resnet achieves the best performance in various electrical appliances.The disaggregation diagrams of the microwave, the washing machine, and the dishwasher are in Figure 8, which shows that, in the actual power consumption of these three electrical appliances, their proportion of \"on\" states is significantly lower than that of the first two electrical appliances. In such unbalanced sample data with a small sample size, the \"on\" states of the washing machine cannot be effectively predicted using the CNN s-s and CNN s-p, whereas the MSA-Resnet presents better results.