Power analysis of smart home appliances based on SSA-TCN

The popularity of smart home equipment has led to higher requirements for equipment automation operation and maintenance. However, the energy consumption status and hidden faults of household equipment cannot be controlled in time only by using traditional monitoring methods. Therefore, this paper proposes a methods of power analysis for smart home appliances based on SSA-TCN using the energy consumption data of smart home appliances. The effective information of the data is extracted through the SSA singular spectrum analysis method, and the data sequence is input into the sequential convolutional network for judgment, so that the energy consumption status and working status of the equipment is obtained. The actual data is used as the training set and the test set to verify the recognition rate of the model. The experimental results show that the recognition rate of the method is about 82%, which provides an effective way for equipment automation and intelligent operation and maintenance.


Introduction
With the advent of the era of the Internet of Everything, more intelligent maintenance of electrical equipment has become an important requirement [1] . In the intelligent operation and maintenance of equipment, there are problems that are difficult to predict and find faults [2][3] . The existing detection devices cannot analyze the power status of the equipment in time. The faults of electrical equipment are mainly reflected in the following aspects [4][5][6] : (1) The complexity of faults. The improvement of equipment intelligence will inevitably follow the complexity of the system, and the resulting faults will also have the characteristics of complexity. Automatic diagnosis technology will become the key technology in the entire fault diagnosis system.
(2) Data complexity. There are many components in complex equipment, and multiple faults are possible at the same time, which brings great difficulty to data processing. There are many types of data generated by the equipment, which brings the characteristics of data complexity.
Traditional methods are mostly based on the external function performance of the equipment or human experience. The accuracy and timeliness cannot be guaranteed, and the true intelligence and automated management. this paper proposes a methods of power analysis for smart home appliances based on SSA-TCN. The SSA principal component analysis method can effectively extract the effective information of the data. The TCN conducts learning and training, establishes a diagnostic model, and analyzes the power status of the equipment in a timely manner to effectively judge whether the power motor of the equipment has abnormal faults.

Singular Spectral Analysis
Singular Spectral Analysis (SSA) is a high-quality method used to study nonlinear time series, which can decompose the time series to obtain signal noise information, trend information, period information, etc. [6][7][8] . It is convenient to preprocess the decomposed data to realize different analysis tasks. SSA decomposition can be divided into four steps: embedding, decomposition, grouping, and reconstruction.

Embed
Suppose the one-dimensional time signal sequence matrix to be analyzed is , and N is the sequence length. Define the window length L and satisfy L≤N, and arrange the sequence x to get the L×K multi-dimensional trajectory matrix:

Singular value decomposition
Multiply the matrix X and its transpose, calculate XXT, and perform singular value decomposition SVD on it, so that L eigenvalues are arranged in order from largest to smallest 1 2 N      , and the corresponding eigenvector is 1 2 , , Among them,

Grouping
The grouping is to distinguish the main components of the signal from other components. In the field of signal processing, generally select the first r singular values (from large to small) so that the sum of the contribution rates is greater than a certain threshold, thereby reflecting the main energy of the signal , Group to get the subset   r X , r≤d.

Refactor
Data reconstruction means that after extracting the main components according to requirements, the matrix is reconstructed into a time series, and the L×K matrix X is reconstructed into a sequence  

Temporal convolutional network
Recurrent Neural Network (RNN) is often used to model the processing of timing problems. However, when RNN processes timing problems, they must be processed in chronological order, which requires a large amount of memory and slow operation speed. In response to this problem, a temporal convolutional network [9] (Temporal convolutional network, TCN) is proposed. So that the traditional Convolutional Neural Networks (Convolutional Neural Networks, CNN) has timing characteristics. Based on CNN, a causal convolution model and memory history (hole convolution, residual module) are proposed.

Causal convolution model
Suppose the one-dimensional sequence to be analyzed is As shown in Figure

Hole convolution
Convolutional neural network CNN often increases the receptive field by adding a pooling layer, but also loses part of the information. The method of hole convolution is to inject holes to increase the receptive field without losing information. The number of kernel intervals in the hole convolution is in t x is defined as: As shown in Figure 2, the cavity convolution is perceived as      Fig.3 SSA-TCN framework This paper takes the long-term monitoring power consumption data of Midea electric fan (model SAD35EA) as an example to introduce the training process. The data set is 6000, 5000 is selected as the training set, 1000 is the test set, and the time resolution is 1min.

Defining the fault state
Define 4 common fault states, 1. Brush wear, excessive wear of the brush between the commutator caused by the motor for a long time, and poor contact; 2 Turn-to-turn short-circuits, the motor windings may be damaged due to manual errors during the production process, resulting in inter-turn short-circuits; 3. Open circuit of armature winding components, armature group may cause open circuit failure due to poor welding and other reasons during production; 4. Winding is unsoldered, and the motor is under strong centrifugal force for a long time. Causes winding disconnection and open circuit. The waveforms of the four fault states are shown in Figure 4.

Singular Spectrum Analysis
The data we collect is often accompanied by information loss or noise [10][11][12] . The SSA process mainly deals with useless data and noise data. In this paper, the current and voltage data of the equipment are mainly used. The data format is fixed. It is necessary to eliminate format error data and denoise the collected data. The signal-to-noise ratio is generally used to describe the severity of signal pollution:

Sample training
The TCN network written in Python is used for training. In this paper, a file in csv format is used for operation. We define the motor data sequence, where n i is the current, n u is the voltage, and n p is the power. Let   Batch_size is an important parameter in machine learning [13] . A reasonable increase in Batch_size will increase memory usage, increase computing speed and reduce the number of iterations. Generally, as the Batch_size increases, the fluctuations caused during the training process become smaller. However, the continuous increase of Batch_size will have some drawbacks. With the increase of memory utilization, the memory capacity will not be able to meet. The number of iterations is reduced when all the data sets are trained once. If the accuracy is to be the same as before, the price paid is that the training time becomes longer, and therefore, the speed of parameter correction becomes slower. When Batch_size increases to a certain value, the downward direction tends to be flat. Therefore, the appropriate Batch_size is very important for network training. Change the Batch_size parameter of the cyclic neural network, take the initial value of 5, the end value of 100, and increase the value of Batch_size according to the step size of 10 to obtain the following 4 error convergence curves. It can be seen from the figure that with the increase of Batch_size, the error presents a trend from large to small, and then increases again. When Batch_size is set to 40, the error convergence effect is the best. (b) hidden=8 (c) hidden=10 (d) hidden=12 Fig.7 Error convergence curve under different hidden layers It can be seen from the above four figures that as the number of hidden layers increases, the error shows a decreasing trend. The number of hidden layer nodes increases to a certain value, and the error convergence is basically unchanged. It can be seen that the number of hidden layers is 10 floors are suitable. The larger the number of training sets, the greater the number of iterations, the more accurate the training results, the trade-off of training time and accuracy, the number of training sets selected for network training in this paper is 5000, and the number of iterations is 400. Table 1 lists part of the training set data, and the overall convergence curve after bringing it into the network is shown in Figure 8.  Fig.8 Error convergence curve of model

Model validation
Randomly shuffle the order of the test set data (1000 items), and the test data is shown in Table 2. Bring into the TCN network model for feature judgment, judge whether it is faulty and output the fault type, the program automatically outputs the recognition time and accuracy rate, Figure 9 shows the verification process, real-time output of the current collected data and network output judgment, as shown in Table 3, you can see The final overall accuracy of the network model is above 82.3%.  Fig.9 Model testing process At the same time, the recognition accuracy rate without SSA preprocessing is compared. As shown in Table 4, it can be seen that the overall recognition accuracy rate of data is significantly improved after SSA preprocessing. If training samples are added, the accuracy rate can be further improved.

Conclusion
This paper proposes a device fault diagnosis method based on SSA-TCN. The effective information of the data is extracted through the SSA method, and the data sequence is input into the sequential convolutional network for judgment, and the fault status of the device is obtained. The accuracy of the model was tested through the test set. The test results show that the accuracy of the model is over 82%. This method can effectively improve the accuracy of recognition and provide an effective way for the intelligent and automated monitoring of equipment.