4.2. Effectiveness Verification of Load Identification Based on the Convolutional Neural Network
Before the real-time load identification, the convolutional neural network model is trained by the category-labeled data from the established library. After being obtained, the one-dimensional current data (as shown in
Section 4.1) are transformed into two-dimensional image data through the data dimension conversion method described in
Section 3.2. Because the maximum current of most common household inserts is limited to 10 A, the maximum operating current of most electrical appliances is usually less than or close to 10 A. Therefore, the vertical axis range of the coordinate axis selected in this paper is from −11 A to +11 A, and the horizontal axis range is the sampling point of one current period when the load is in steady-state operation. The maximum current of a few electrical appliances exceeding 10 A applies the same operation, and the identification result is not affected.
The labeled appliances in the library are re-numbered to represent the categories of the load in the process of convolutional neural network identification. The load re-numbering of the library established in
Section 4.2 is shown in the
Table 3.
The numbers of convolutional layers and pooling layers are extremely important for the classification accuracy of the model.
Figure 9 shows the classification accuracy under different numbers of convolutional and pooling layers. When the number of convolutional and pooling layers is less, the parameters are insufficient for the accurate classification of the sample. With an increasing number of layers, the effectiveness of the model’s classification process is clearly improved. However, when the layers continue to increase, the increased training parameters raise the difficulty and time of model training. Limited by the current training methods, the increase in layers is more likely to make the classification results fall into the local optimum, leading to over-fitting and other problems. As shown in the figure, when the convolution and the pooling layer are both set as 3, the model is most effective, and the classification accuracy of the test sample can reach 96.73%. Therefore, considering the accuracy and training time of the model, the number of both the convolutional and pooling layers in the convolutional neural network model is determined as 3. In addition, under this optimal layer structure, the kernels 1, 2, and 3 are set as convolutional layers 1, 2, and 3 respectively, as shown in
Table 4.
In general, 3 × 3 is the popular choice of kernel size in the convolutional neural network, which is determined by the empirical value in the experiment. Specifically, the kernel size of the convolutional kernel is set to be larger than 1 × 1 to enhance the receptive field. A kernel with an even size cannot ensure the same size of the feature map in the input and output. In the case of the same receptive field, the required parameters and computation are increased with the size expansion of the convolutional kernel. Thus, the kernel size of 3 × 3 is used for the first convolutional layer. In order to extract the output image feature of the previous convolutional layer further, the kernel size of the convolutional layer increases gradually, so the second convolutional layer size is set as 5 × 5. In addition, the third layer is the last convolutional layer, followed by the fully connected layer. The input of the fully connected layer needs to be one-dimensional data, which have the same dimension with the output of the third convolutional layer. However, the output dimension of the convolutional layer depends on the input data dimension and kernel size. Considering that the input data dimension of the third layer is 12 × 12, the kernel size of the third convolutional layer is set as 12 × 12. Besides, the size of 12 × 12 is set to reduce the parameter numbers of the fully connected layer significantly. As for kernel numbers, if there are less numbers in the convolutional layers, the extracted image features are not enough for identification, and the model struggles to achieve the desired performance. On the contrary, if the kernel number is set to be oversized, it will incur the problem of model parameters and training speed increasing significantly, as well serious over-fitting problems. Thus, the kernel numbers are empirical values obtained by repeated experiments.
After the determination of the model structure, the model parameters become significant factors in the training process. The parameters of learning rate and epoch are related to the convergence and training speed of the model. The learning rate
μ represents the amount of weight updating in each time. If the set value of learning rate is too high, the loss function and model will struggle to converge. On the contrary, if the learning rate is too small, the updating of weights and the change to the model cost will be very small each time, resulting in significantly more epoch times. Epoch times are the training times of all sample data.
Figure 10 shows the cost value of the convolutional neural network model training under different learning rates. It can be seen that the identification model tends to converge and the convergence speed is faster at a learning rate of 0.05. When the number of epoch is 500 (i.e., epoch = 500), the loss values in the model are all below 0.003.
Figure 11 illustrates the parameters of the convergence process in the model. Six parameters are selected for display. The parameters
kernel_c1 and
bias_c1 are one of the weights and one of the biases in the second convolution layer, respectively. The parameters
kernel_f1 and
bias_f1 are one of the weights and one of the biases in the third convolution layer, respectively. Besides,
weight_f1 is one of the weight parameters between the third convolution layer and the fully connected layer. The parameter of weight output is one of the weights between the fully connected layer and the softmax layer. The detailed values of the above six parameters under different epoch times are shown in
Table 5.
It can be seen that the parameters show a gradual increasing trend as the epoch time increases. There is no significant change in the above parameters when the epoch value is greater than 500. It can be considered that the model is trained to converge when the epoch reaches 500. Thus, this paper chooses the number of epoch as 500 to ensure the training efficiency of the model.
In order to display the model identification results, 12 separated current waveforms in
Figure 6 are identified by the convolutional neural network model.
Figure 12 shows the model input data after dimension conversion by the method proposed in
Section 3.2.
In the process of identification using the convolutional neural network model, the signature maps extracted from the input data after the first convolutional operation are shown in
Figure 13. It can be seen from the figure that the contour edge and other features of each load current waveform in
Figure 12 are strengthened and extracted by the kernel in the convolutional layer.
After processing of pooling and activation further, the signature maps are shown in
Figure 14. It reduces the feature dimensions of the images in
Figure 13, and makes non-linear mapping on the feature image, so as to extract the advanced features for identification.
Table 6 gives the classification confusion matrix of the algorithm. The column of the confusion matrix represents the identification label of each load category, the row represents the real label, and the diagonal value represents the accuracy of the correct classification of the load. The identification accuracy increases with the background color deepening.
In order to present the accuracy of results of the proposed method, the collected data of day1–day3 are identified by the proposed method, and the power consumption ratio of different loads is presented in
Figure 15. As a comparison, smart sockets are installed to the monitoring appliances to obtain the true power consumption, which is shown in the right part of the figure. It can be seen that the total consumption difference between the calculated one and the true one is less than 0.3 kW. The consumption ratio of each load is nearly the same as the true value given by the socket, and the load has the correct label.
In addition, the algorithms proposed by Chao et al. [
19], Srinivasan et al. [
21], Ahmadi et al. [
22] and the genetic algorithm are selected to compare against the proposed method. The above typical algorithm shows good performance on NILM and the feasibility of the proposed method is proved by a comparison of the algorithms. In reference [
21], the neural network is also applied to NILM in [
21] as proposed by Srinivasan. A typical neural network is used to verify the effectiveness of load identification through the model training of neural networks. Different from our work, the neural networks are trained to extract harmonic signatures from the current for load identification. Then, Ahmadi et al. [
22] propose a graph signal processing (GSP) approach for NILM. The graph is also formed by steady-state signatures of loads. It poses the load disaggregation problem as a single-channel blind source separation problem to perform low-complexity classification for load identification. It proves that the load can be identified by processing the signal of a load graph, but it is different from the transformation method of the graph signal in the proposed method. Similarly, with our method, the convolutional neural network is also applied to NILM to form a three-step non-intrusive load monitoring system (TNILM) in Chao’ work [
19]. Due to the purpose, dimension, structure, input and output data of the convolutional neural network, the proposed algorithm outperforms that in Chao’ work. In addition, the traditional intelligent algorithm is widely used in non-intrusive load identification. Genetic algorithm optimization is a conventional intelligence algorithm. Thus, as a supplement, genetic algorithm optimization is used as another method of load identification after the library construction to replace the convolutional neural network in this paper for comparison.
Figure 16 shows the performance comparison curves with the above mentioned method. The comparison of the algorithms’ accuracy of load identification is shown in
Figure 16a. The increasing load categories have less influence on the algorithm in this paper. The operational efficiency curves are shown in
Figure 16b. In the actual stage of load identification, the proposed method has higher operational efficiency and a stable time of load identification. Represented by the violet line, the TNILM in Chao’ work [
19] includes the convolutional neural network and a multi-label classifier, so it has a relatively long operation time. Denoted by the blue line, the running time of the algorithm in Srinivasan’ work [
21] increases rapidly with a rising load number. Represented by the green and orange lines, respectively, the GSP algorithm and the genetic algorithm optimization have more stable operational efficiency, but are overall slower than the algorithm in this paper.