Multi-layered Nonnegative Matrix Factorization Based on PCA for the Foreign Object Detection in Electricity Meters

Foreign object detection is an important part ofquality control of electricity meters. An automatic detection device is developed based on acoustic identification. In order to suppress background noise interference, we design a novel sound separation algorithm to separate the mixed sound signals to obtain the target source signal produced by foreign objects. Firstly, the improved principal-component-analysis-based multi-layered nonnegative matrix factorization (PMNMF) is used to separate sound signals. Secondly, the SVM is used to classify and identify sound signals. A suppot vector machine (SVM) as the classifier is used to compare the PMNMF algorithm with the basic NMF algorithm. The results indicate that the sound data pre-processed with the improved NMF algorithm results in a significantly higher identification rate up to about 95%.


Introduction
With the widespread application of the electricity meters, their measurement accuracy and reliability are of great importance. Electricity meters must pass a whole set of verification items before being used for measurement. Foreign object detection is one of the verification items. The manual detection method of "manual shaking and ear hearing" is traditionally adopted to detect the foreign object in the electricity meters. The automatic detection device collects the sound signal generated during the shaking of the meters, and uses the acoustic identification method to complete the detection of foreign objects. Due to the complexity of the structure of the detection device and the presence of background noise interference, it is difficult to accurately detect the foreign objects. Moreover, choosing a reasonable classification algorithm can improve the accuracy of foreign object detection.
Many methods for sound enhancement have been developed, including wavelet analysis [1], empirical modal decomposition [2,3], integrated empirical modal decomposition [3,4], empirical modal decomposition and wavelet combination [5], and blind source separation [6,7], etc. Wavelet analysis requires the selection of basis function, decomposition layer number and wavelet threshold value. Reasonable selection has great influence on the result of de-noising. Although empirical model decomposition avoids these problems, it still has some problems, such as endpoint effect, mode aliasing, etc. Integrated empirical mode decomposition alleviates the mode aliasing of empirical mode decomposition by adding white noises with uniform distribution. As the sound signal collected in the electricity meters can be regarded as a variety of mixed sound signals, blind source separation is commonly used to separate the mixed signals. Traditional independent component analysis (ICA) is more effective when the components of the source signal are independent of each other, but ICA analysis is more complex due to the presence of background noise and the correlation between the signals collected, even leading to separation failure. Nonnegative matrix factorization (NMF) is a kind of matrix decomposition method as well as the ICA analysis, the only difference is nonnegative matrix decomposition ensures nonnegative matrix elements, which has better interpretability and physical significance in practice. It is possible to get better separation signals by adding reasonable constraints to the decomposition matrix.
Chuan-Yu Chang and Yi-Ping Chang [8] investigated the identification rate of the support vector machine (SVM) in the indoor abnormal voice identification system, and the results show that a identification rate of 86% can be achieved for different kinds of abnormal sound signals. M. M. Azmy [9] used SVM to classify the lung sounds of patients according to the problem that doctors cannot accurately detect lung sounds of patients, reaching a identification rate of 95.24%. SVM has a good performance in the detection of sound classification or abnormal sound, and it can also achieve a good recognition rate for small samples.
The rest of this paper is as follows: the second section presents the foreign body detection device, the third presents the basic NMF principle and the improved NMF algorithm respectively, the fourth elaborates the principle of SVM algorithm in detail, the fifth section presents the experiment based on the collected experimental data, describes the experimental results and data analysis, and the sixth presents the conclusions based on the experimental results.
In this paper, the sound signals in the electricity meters are collected by an automatic detection device. The internal structure of the data acquisition device is shown in FIG.1, and the overall appearance is shown in FIG.2. In the process of signal collection, the microphones are placed close to the bottom wall of the roller, and the electricity meter is placed in the circular roller above the device, as shown in FIG.1. Sound insulation material is used for separation between adjacent electricity meters, and each electricity meter is fixed separately to prevent influencing each other. The meter shaking box and the drive component are mounted on a fixed frame. The drive component is connected to the meter shaking box through two sets of magnetic coupling components. The drive component includes stepper motor, reducer and transmission shaft. When working, the motor provides clockwise and anti-clockwise rotation drive for the fixed components of the electricity meter, so as to simulate the action of manual shaking of the electricity meter and drive the fixed components of the electricity meter to perform variable acceleration motion. The signals are then collected by electrically driving the meter shaking device at an appropriate angle from left to right.

Basic NMF principle
Nonnegative Matrix Factorization (NMF) [10] is a new matrix decomposition method proposed by Lee and Seung in 1999. The basic NMF idea can be described as follows: for any given nonnegative matrix Vn×m, NMF can find two nonnegative matrices Wn×r and Hr×m , with V≈WH, so as to decompose a nonnegative matrix into the product of two nonnegative matrices. In the problem of sound enhancement, V represents the spectral amplitude matrix of n m-dimensional observation signals, W is the hybrid matrix, and the H represents the source signals of r m-dimensional observation signals. The number of source signals can be obtained by the singular value of the observation matrix or estimated on the basis of prior knowledge of the existing signal sources (estimated in this paper as 2). Two classical cost functions are given in literature [11], as shown in equations (1) and (2).
Where W and H is nonnegative, and for any k we (1) adopts Euclidean distance, and equation (2) adopts KL distance.

Improved NMF algorithm
In practical applications, constraints other than nonnegativeness, such as sparseness, orthogonality and smoothness are imposed on the decomposition results W and H, which makes the decomposition results more reasonable. The basic NMF decomposition results are greatly influenced by the initial value; moreover, there is a certain correlation between actual signals. In view of the above facts, this paper proposes a multi- can be separated as far as possible, the variance of sample points after projection should be maximized. Using this idea, firstly, the basic matrix W is selected. The original data projection coefficient matrix H in this direction has a large variance. In order to make the coefficient matrix H have a large variance among different columns, the variance between different columns is added as a penalty term on the basis of the cost function of the original nonnegative matrix decomposition, so as to separate the mixed signals as much as possible. The resulting loss function is: According to equations (4) and (5) ) ( The following updating rules are obtained: Secondly, multi-layered nonnegative matrix decomposition is adopted. Its main idea is to decompose the observation signal several times with different initial values, so as to find the solution closer to the global optimum. The specific method is to decompose the matrix V by using NMF first to obtain V=A 1 S 1 , and then the matrix S 1 is decomposed by using NMF in turn to obtain S 1 =A 2 S 2 . The number of decomposition layers can be set in the actual processing. The steps to separate mixed signals by using the PCA-based multi-layered nonnegative matrix decomposition (PMNMF) are as follows: 1) Fourier transform is performed on the observation signal, and nonnegative matrix V is obtained by taking its amplitude spectrum.
W and H are initialized to be any non-negative matrix.
2) We set the iteration error δ of the objective function, the maximum number of iterations per layer T max and the number of decomposition layers L.
3) Judge the error of the target function of two adjacent iterations. If it is not greater than δ , jump to (5); otherwise, continue to iterate. If the number of iterations T max is reached, go to the next layer until the number of decomposed layers L is reached.

Recognition of foreign objects based on SVM
Traditional voice recognition is realized by establishing neural network classifier, which has certain adaptivity and does not require much prior knowledge, but the training of neural network requires a large number of samples. In addition, the complexity of structure and inappropriate parameter adjustment may lead to low accuracy of foreign body detection. Support vector machine (SVM) is a machine learning algorithm based on structural risk minimization, which reasonably solves the problem of large training sample requirements and over-fitting of neural network, and provides a new possibility for accurate detection of foreign body in the electricity meter in the case of small samples [12]. SVM is based on the idea of mapping data from low-dimensional space to high-dimensional space, and the optimal dividing line is determined by the support vector. SVM first finds the vectors that have good discrimination ability for classification, and then constructs the classifier that maximizes the spacing between classes, which is a discriminant classifier defined by the separation hyperplane [13]. To calculate the optimal hyperplane, the hyperplane is defined in equation (9). x β is the weight vector, and α is the bias. In order to obtain infinite optimal hyperplanes, the scaling defined in equation (10) is carried out.
x represents the training set closest to the hyperplane, which is called the support vector. We use equation (11) to get the distance from the point x to the hyperplane The distance from the support vector to the hyperplane is defined in equation (12).
The classification interval is twice the distance from the support vector to the hyperplane, which is defined in equation (13).
The maximization of the classification interval of equation (13) is equivalent to the minimization under certain constraints. The constraint conditions express the requirements for the correct classification of all training sets as shown in equation (14).
The label y i represents the i-th training set. Considering that SVM can better solve practical problems in the case of small samples, non-linearity and high dimensionality, this experiment adopts SVM classifier to verify that the improved NMF algorithm has better detection performance than the basic NMF algorithm.

Experimental results and analysis
The experimental data were derived from the foreign body sound signal in the electricity meter actually collected in the factory (the known foreign body frequency is concentrated at 3000Hz∼4000Hz). 100 sound samples with foreign body and 100 sound samples without foreign body were selected to form the sample set. The sample data set is randomly divided into two mutually exclusive sets by using the hold-out method. The training set and the test set take up 80% and 20% of the sample data set respectively, and the average recognition rate under different experiment times is calculated respectively. Table 1 shows the corresponding average recognition rate for different laboratory times. FIG.3 and FIG.4 show the results of the improved NMF algorithm and the basic NMF algorithm separating signals respectively FIG.5 and FIG.6 show the recognition rate after the treatment of the improved NMF algorithm and the basic NMF algorithm in 500 experiments and 1000 experiments respectively.     As can be seen from the separation spectrum of FIG.  3 and FIG. 4, as compared with the basic NMF algorithm, the improved NMF algorithm has better separation results for the sound signals in the actual electricity meters, and the separation signals basically do not overlap. It can be seen from FIG. 5 and FIG.6 that the data processed by the improved NMF algorithm has a better detection accuracy rate compared with the data processed by the basic NMF algorithm, which basically remains around 95%.

Conclusion
On the basis of basic non-negative matrix decomposition and non-negative constraint, other constraints are more favorable for the separation of mixed signals. The principal component analysis (PCA) is used to maximize the variance between different columns in the decomposed coefficient matrix to reduce the correlation between source signals, and the multi-layered nonnegative matrix decomposition is used to avoid unreasonable initial value selection, which makes it difficult to find the global optimal solution. The experimental results show that the improved PMNMF compared with conventional non negative matrix decomposition is more conducive to the complete separation of the signal, the recognition rate after processing is significantly higher, reaching about 95%.