Nonintrusive Monitoring for Electric Vehicles Based on Zero-Shot Learning

Monitoring the charging behavior of electric vehicle clusters will contribute to developing more effective energy management strategies for grid operators. A low implementation cost leads to a wide application prospect in nonintrusive monitoring for EVs. Aiming at the problem that traditional nonintrusive monitoring methods cannot identify unknown devices accurately due to the lack of classes, a nonintrusive monitoring method based on zero-shot learning (ZSL) is proposed in this article, one which can monitor the unknown types of EVs connected to charging piles. First, the charging characteristics of known EVs and unknown EVs are extracted by dictionary learning. Then EVs are classified by ZSL based on sparse coding. Furthermore, EVs are decomposed based on the proposed multimode factorial hidden Markov model (FHMM). Finally, the EV dataset of Pecan Street is used to verify the effectiveness and accuracy of the proposed method.


INTRODUCTION
With the continuous improvement of the penetration of renewable energy, the gradual decline in the electricity price has been making EVs more appealing to consumers (Liu et al., 2013). The promotion of EVs is regarded as one of the effective means to achieve energy conservation and emission reduction. When a large number of EVs are connected to the grid for charging and discharging, EVs are no longer just transport agents but also controllable loads and distributed energy sources in the energy system Wang et al., 2021b). In this sense, EVs are distributed and mobile energy storage units.
However, the random and uncertain behavior generated by the EVs' charging demand will have many negative effects on the grid (Ahmadian et al., 2015;Mehta et al., 2018). These effects include increased peak power demand and overloads on feeders and transformers, especially in the distribution network (Li et al., 2019;Wang et al., 2020a). Therefore, it is necessary to monitor the charging and discharging behavior of EVs.
According to the EV charging environment, EV monitoring can be divided into household EV monitoring and parking lot EV monitoring (Rastogi et al., 2019). At present, the minimum charging and discharging power of EVs sold on the market is 3 KW, which is 5-10 times that of most household appliances. When the household charging pile is connected with EVs, the power fluctuation is obvious. For parking lots equipped with charging piles, most of them are planned in buildings, such as apartments, office buildings, and shopping malls. Due to the high power demand of EVs, it is significant to monitor such EV clusters: 1) For the parking lot with a large number of charging piles, its charging behavior has a certain regularity and synchronization, and such cluster charging behavior will generate a surge in the electricity demand . In order to ensure intelligent charging of EVs, the power grid/third-party assistance can monitor EV charging in a more intelligent way (Dickerman and Harrison, 2010;Rastogi et al., 2019); 2) Charging an EV takes longer than filling up an internal combustion engine vehicle. The real-time queuing information for EVs can be provided by monitoring the parking lot equipped with charging piles, including the number of EVs being charged and the estimated waiting time (de Weerdt et al., 2016;Goel et al., 2020); 3) In the long-term vision, one of the goals of the smart grid is to optimize the power service economy by establishing a twoway relationship between the power grid and EVs (Zeff, 2016). EVs can be regarded as energy storage. In the future, the advantages of short-term storage of EVs can be used to charge in the trough power demand and feed energy back to the grid in the peak power demand (Ahmadian et al., 2020;Wang et al., 2021a).
EV monitoring can be divided into intrusive monitoring and nonintrusive monitoring (NIM). Measurement data of each charging pile are required to be collected in intrusive EV monitoring, so as to realize real-time charging and discharging power monitoring of EVs. This intrusive monitoring method has a high cost of installation and maintenance due to the need to install a data acquisition device on each charging pile. The nonintrusive monitoring method was proposed by Hart in 1992. This method only needs the aggregated data measured at a single metering point to effectively realize the monitoring and identification of EVs.
In recent years, in the field of nonintrusive monitoring, many scholars have devoted themselves to improving the accuracy and applicability of NIM technology. Various methods have been used for NIM. An energy decomposition algorithm based on the adversarial network and the joint adaptation network is applied to NIM, which reduces the distribution gap of the feature space and the label space between the source domain and the target domain (Liu et al., 2021). A multitask NIM model based on the deep neural network is proposed, which can simultaneously analyze energy estimation and load state detection (Cimen et al., 2021). A hybrid event detection method is used for NIM for devices with long transients, high fluctuations, and/or near simultaneous action (Lu and Li, 2020). A multi-label classification method based on sparse representation classification is proposed, which can realize a fuzzy clustering algorithm inspired by NIM competitive-aggregation constrained by the entropy index through less training data (Singh and Majumdar, 2020). A low-complexity unsupervised NIM algorithm is proposed for the use of devices in families (Liu et al., 2019). In view of device feature representation in eventbased NIM, Faustine et al. combined the adaptive weighted recursive graph block with the deep neural network architecture for device identification (Faustine et al., 2021). A convolutional neural network based on multi-scale features and context information is used to improve the accuracy of load decomposition (Chen et al., 2020). In order to improve the accuracy of new data decomposition, Hasan Rafiq trained the deep convolutional neural network model through data expansion (Rafiq et al., 2021). Taking advantage of the fact that the HMM can model multimode devices separately, a layered hidden Markov model (HHMM) is used for load decomposition of household appliances, one which can conduct nonintrusive monitoring of appliances with multiple modes and different power consumptions (Kong et al., 2018).
Recently, with the popularity of EVs, nonintrusive EV monitoring has gradually attracted the attention of scholars. On the basis of NIM, a training-free, nonintrusive load extraction algorithm was proposed based on boundary box fitting and load characteristics (Zhao et al., 2019), which can automatically identify the start time, end time, and power amplitude of charging events. Based on the low-frequency characteristics of the charging load mode, a charging load extraction method based on residential smart meter data was proposed to realize the nonintrusive extraction of the residential EV charging load mode (Xiang et al., 2021). Based on independent component analysis, an unsupervised EV charging load extraction method is proposed in the study by Munshi and Mohamed (2019). The proposed algorithm only requires the low-frequency active power measurement data. A nonintrusive identification method for EV charging curve extraction driven by a depth generation model is proposed in the study by Wang et al. (2020b). The proposed Markov model embedded in the presentation layer can solve the likelihood distribution overlap of learning.
However, there are many types of EVs and various battery types in EVs, and NIM needs to know the types and characteristics of monitored objects in advance, which greatly limits the accuracy of monitoring EVs.
Zero-shot learning (ZSL) provides an effective solution to the problem of class absence in nonintrusive EV monitoring. ZSL refers to the technology of using some known category data and the auxiliary information corresponding to the known category to train a certain model, so as to realize the classification and recognition of the data of the unknown category. A ZSL approach is proposed to simulate knowledge transfer between classes by learning visually consistent word vectors and tag embedding models (Demirel et al., 2019). The main idea is to project the vector space word vectors of attributes and classes into the visual space, so as to make the word representation of semantically related classes more close and, furthermore, use the proposed projection vector embedded in the model to identify the invisible classes. A transfer-sensing embedded projection method to solve multi-label ZSL learning was proposed in the study by Ye and Guo (2019). In this method, the label embedding vector is projected into a low-dimensional space to induce a better inter-label relationship, and the multi-label classifier with the largest boundary is learned via the projection label embedding. A ZSL classification method is proposed, which can automatically learn label embedding from input data in a semi-supervised large-profit learning framework, in the study by Li et al. (2015). A generation model is proposed, which simplifies the ZSL problem to a supervised classification task, in the study by Sariyildiz and Cinbis (2019). A ZSL method based on unsupervised domain adaptation was proposed in the study by Kodirov et al. (2015). In order to overcome the problem of the domain shift in the process of ZSL projection, the method regularized sparse coding to regularize the target domain projection.
In view of this, this study proposes a nonintrusive EV monitoring method based on the ZSL factor hidden Markov model. Firstly, the charge-discharge characteristics of known EVs and unknown EVs connected to the charging pile were extracted by dictionary learning. Furthermore, ZSL based on sparse coding is used to classify EVs. Finally, EVs are decomposed based on the proposed FHMM based on the bilateral long-term and shortterm memory network (Bi-LSTM).
The rest of this article is organized as follows: Section 2 describes the nonintrusive EV monitoring and extracts and classifies the charging and discharging status of EVs, Section 3 proposes an FHMM-based EV decomposition method, Section 4 discusses the proposed method of performing simulation and verification, and conclusions are drawn in section 5.

EVS' CHARGE-DISCHARGE STATUS EXTRACTION AND CLASSIFICATION
A framework of nonintrusive monitoring for EV clusters is given in Figure 1. The data monitored using the meter include the building load and the EV charging load. In the study by Munshi and Mohamed (2019), the existing EV charging loads are summarized into seven types, as shown in Table 1. However, as the market for EVs gradually expands, the charging power of EVs will also be varied. During nonintrusive monitoring of EVs' charge-discharge power, EVs of an unknown charge-discharge model are identified. In the parking lot of Figure 1, there are seven known-model EVs and one unknown-model EV.

Definitions
The total power time series monitored using the meter is x {x 1 , x 2 , . . . , x T }, where the EVs' charge-discharge power time series is P {P 1 , P 2 , . . . , P T }. The parking lot has M charging piles, one charging pile supports only one EV access,  and the charge-discharge power time series of the m − th charging pile is p m {p m,1 , p m,2 , . . . , p m,T }. p m,t represents the magnitude of the charging power at time period t for the m − th charging pile. In other words, the total power curves of M charging piles represent the charge-discharge power time series of EVs in this region. In addition, a maximum of M EVs are charged and discharged at time period t. Furthermore, in the time period t, s m,t represents the charge-discharge state of the charging pile, that is, if the charging pile is in the charging state, then s m,t 1; if the charging pile is in the stopping state, then s m,t 0; and if the EV is in the discharging state, then s m,t −1. It is worth noting that one charging pile may successively access multiple different types of EVs in the time series T. Although the charge-discharge state of the charging pile is a time series of (0, 1, −1), the charge-discharge power may vary in size.

Description of the Problem
Suppose the time series of the EV charge-discharge power of the group N EV is known, and the known dataset constituted by it is D EV {(p EV,i , y EV,i )} N EV i 1 , where p EV,i represents the charge-discharge power time series of the EV of the group i and y EV,i represents the corresponding EV label. Each known class EV label comes from a collection Y EV of known class labels, that is, where Q EV is the number of known-type EVs. In addition, the time series of the charge-discharge power of the group N X of EVs to be identified constitutes the unknown dataset D X {(p X,i , y X,i )} NX i 1 . For each unknown power time series p X,i , its label y X,i comes from the unknown class label set Y X , that is, where Q X is the number of unknown-type EVs. The set Y EV of known category labels and the set Y X of unknown category labels constitute the complete set Y of categories, and the set of known category labels and the set of unknown category labels do not intersect with each other, that is, In most studies at home and abroad, the nonintrusive monitoring problem for low-frequency data is mostly regarded as a load decomposition problem, and the related technologies mainly have two subtasks: 1) classification and 2) reconstruction. First, the operation state of the device can be divided into known classes by classification, and second, the time series monitored using the meter can be reconstructed based on the classification results. Based on the purpose of nonintrusive monitoring, a nonintrusive EV recognition method based on zero-sample migration learning is proposed in this study. The classification model is trained by using the known dataset D EV {(p EV,i , y EV,i )} NEV i 1 of EVs and its auxiliary information, and the knowledge learned by the known dataset is effectively migrated to the unknown dataset, so as to realize the classification of the unknown EV dataset.
Considering the case of the unknown type of EVs accessing charging piles for charge-discharge, there is a mapping offset problem due to the poor generalization ability of the mapping model when classifying the operating state of EVs. It is shown that in the training process, the model maps the time series of known EVs' charge-discharge power into the known class label space in the semantic space, and due to the lack of the unknown dataset composed of the time series of EVs' charge-discharge power to be identified, the classification model will not map the unknown dataset into the unknown class label space at the time of testing, that is, there is a mapping offset, and the unknown EV category cannot be accurately identified.

Zero-Shot Classification Based on Sparse Coding
To solve the mapping offset problem of unknown-type EVs in the recognition process, this study converts the projection function learning problem into a sparse coding problem using the unsupervised domain adaptive model proposed in the study by Kodirov et al. (2015) as follows: each dimension of the semantic embedding space corresponds to the dictionary base vector, and the sparse code of each feature vector is its projection in the semantic embedding space. Regularity terms are introduced separately for the dictionary learning problem of the charge-discharge power time series of known-type EVs and unknown-type EVs. The known-type EVs' semantic dictionary learning problem can be expressed as follows: where L EV is the semantic dictionary of known-type EVs, H EV is the semantic representation of known-type EVs, · F is the Frobenius norm, and λ controls the strength of the regular term.
Unlike known-type EVs' semantic dictionary learning, in unknown-type EVs' semantic dictionary learning, both the unknown-type EV semantic dictionary L X and the unknowntype EV semantic representation S X are unknown. To overcome the domain offset problem during learning, that is, mapping offset, L EV and H X time is used to optimize L X . Therefore, the unknown-type EVs' semantic dictionary learning problem can be expressed as follows: where L X 1 N X i 1 l i 1 , q j is the representation of y X,j in the semantic embedding space, and ω ij is the probability that the input time series belongs to the label y X,j , whose size can be estimated using the IAP model (Lampert et al., 2009). The first regular term L X − L EV is used to limit the fitness of L X vs. L EV , and the second regular term h i − q j is used to limit the similarity of the representation of unknown-type EVs' power time series in the semantic embedding space to the representation of unknown-type EV labels in the semantic embedding space. Based on Eq. 3, the method of alternating iteration is used to solve one, and H X and L X are fixed to solve another, as follows:

FHMM Model
The HMM can well describe the influence of the system equipment state change on the system output. The traditional HMM structure is given by, and its model θ can be expressed as follows: where A is the state transition matrix, B is the observation matrix, and π is the initial state probability distribution, which is expressed as follows: where φ(x t |s t i) denotes the output probability of the state s t i to the observation matrix x t , which obeys a normal distribution, μ i is the mean vector, and ε i is the covariance matrix of the observation matrix.
In the HMM-based nonintrusive monitoring problem of EVs, π and A determine the EVs' charge-discharge state sequence, and B determines the EVs' charge-discharge power time series P 1: T {p 1 , p 2 , . . . , p T }. The nonintrusive monitoring of EVs based on the HMM can be divided into two stages: model parameter estimation and observation matrix decoding. In the model estimation stage, the model parameters are estimated by unsupervised learning or supervised learning, so that the probability of observed EVs' charge-discharge power time series under this model parameter reaches the largest, that is, θ * arg max φ(x|θ); in the observation matrix decoding stage, the charge-discharge status and charging power of each charging pile are decomposed according to the optimal parameter θ * estimated in the previous stage and the input EV charge-discharge power time series x t .
The charge-discharge states of EVs can be represented by Figure 2. EVs' charge-discharge state can be divided into the OFF state and the ON state. The OFF state represents that EVs are in the standby state due to system scheduling or full battery power, which is equivalent to ending the charge-discharge behavior, that is, changing from OFF to End; the ON state represents that EVs are in the charge-discharge state, and there is a certain probability of ending the charge-discharge state. According to the EV charge-discharge state transfer rule, the charge-discharge state of the charging pile during the time series T can be expressed as S 1: T {s 1 , s 2 , . . . , s T }, where s t {−1, 0, 1}.
According to the EV cluster monitoring framework depicted in Figure 1, the nonintrusive monitoring structure based on the FHMM is shown in Figure 3. Since the observable time series in this FHMM framework is the total power output containing the building and parking lot charging stakes, and not the EV charge-discharge power time series, P 1:T needs to be extracted from X 1:T {x 1 , x 2 , . . . , x T }.

Bi-LSTM Model
In the process of extracting P {p 1 , p 2 , . . . , p T }, upon considering the state of charge (SOC) of the battery in EVs, it is not only determined by the current moment t and the future period t+ charge-discharge power but also by the charge-discharge power of the past period t−. Conventional LSTM performs forward transfer updating of the hidden layer state via one-way time series input when training, while full epoch data of X 1:T are required when extracting EVs' charge-discharge time series. Based on this, in this study, P 1:T is extracted using Bi-LSTM, and its structure is shown in Figure 4. The output expression of the bidirectional LSTM is as follows: where p forw ϑ,t , p back ϑ,t , and p join ϑ,t are the outputs of the forward LSTM neural network, the reverse LSTM neural network, and the Bi-LSTM in the hidden layer of layer ϑ at time t, respectively; υ is the number of hidden layers. The LSTM network used in this study contains six layers, in which the length of the input layer is the length of the time window t, the second layer is the convolution layer, which is used to extract features from the signal, the third and fourth layers are Bi-LSTM, the fifth layer is the convolution layer, and the sixth layer is the full connection layer. The whole network is

Nonintrusive EV Decomposition
In the framework shown in Figure 3, we note that although the charge-discharge time series of each charging pile are independent of each other, that is, M parallel Markov chains. Compared with the 3 M state combinations of HMM charging piles at time t, the decomposition of EVs based on the FHMM effectively reduces the complexity of the decomposition algorithm.
Considering that the known types of EVs are limited and the charge-discharge time series of the same type of EVs are similar, there may be multiple EVs of the same type for charge-discharge at time t. Based on the EVs' charge-discharge characteristics, this study further reduces the computational complexity of the EV decomposition model and classifies the same type of EV charge-discharge state at time t into a Markov chain. The improved HMM structure in Figure 5 shows that there are Q + 1 types of EVs, of which Q types of EVs are known, and (Q + 1)th is an unknown type of EV accessed by the charging pile. Here, the number of each type of EV accessed by the charging pile is assumed to be {d 1 , d 2 , . . . , d Q }. Therefore, the charge-discharge state of EVs of type q − th at moment t can be expressed as follows: FIGURE 3 | Framework of nonintrusive monitoring for the EV cluster.
Frontiers in Energy Research | www.frontiersin.org August 2021 | Volume 9 | Article 720391 In the process of EV decomposition, considering that there are many unknown types of EVs connected to the charging pile and the charge-discharge power of unknown types of EVs is different, because the specific model of unknown types of EVs cannot be given, all unknown types of EVs' charge-discharge behavior is equivalent to a storage battery with unknown charge-discharge behavior in this study. When one unknown type of EV is connected to the charging pile, the hidden state is {1, 0, −1}, and when two unknown types of EVs are connected to the charging pile, the hidden state is 1, , −1 . The nonintrusive FHMM model parameters based on clusters of EVs can be expressed as follows: The FHMM model is composed of clusters of the same type of EV, each HMM chain represents the same type of EV, and the charge-discharge power and charge-discharge status are independent of each other between each type of EV. Therefore, the HMM model parameters constituted by each type of EV cluster are solved one by one, and thus obtain the total FHMM model parameters, such that the following occurs: In this study, the EM (expectation maximization) algorithm is used to estimate the model parameters of Eq. 9. Two auxiliary variables, one forward variable α Based on the α (q) 1 (i) forward recursion, the following occurs: The backward variable β (q) t (i) represents the probability of observing an EV charge-discharge time series of type q − th as p (n) t+1 , . . . , p (n) T at time t and the charge-discharge state i. Given an initial parameter θ 0 , β (q) t (i) can be expressed as follows: Similarly, the backward variable β (q) t (i) can also be calculated using the recursive formula as follows: where the initial value β (q) T (i) 1. Based on the two variables above, the FHMM decomposition process for a given initial parameter θ 0 and the observation sequence T ] can be divided into the following two steps: 1) E-Step: Compute the probability ξ (q) t (i, j) of EVs of type q − th shifting from state s   After all the parameters of the FHMM model are obtained, the hidden state can be decoded by applying the Viterbi algorithm to the summarized power consumption sequence. In the Viterbi algorithm, the variable δ t (i) is introduced. We define δ t (i) as the probability maximum of all states {s 1 , s 1 , . . . , s t } to the observation sequence {p 1 , p 2 , . . . , p T } at the moment t as follows: where N is the number of hidden layer states of EVs, t 1, 2, . . . , T.

Dataset Description
In order to verify that the method proposed in this study can classify unknown types of EVs effectively and, furthermore, monitor the charging behavior of EVs accurately, the processed EV dataset of Pecan Street is used for training and testing. Specifically, the dataset consists of 16,000 sets of EV charging data belonging to eight types. In the ZSL process, seven types of known EV data are used for training and one type of unknown EV data is used for testing, among which power levels of EVs are used as EV labels, that is, Y EV {3, 3.3, . . . , 10}. The data sampling interval is 1 min. Charging services for EVs are provided by 120 primary/ secondary charging piles.

Zero-Shot Classification
In order to ensure that the method proposed in this study can accurately identify the access of unknown types of EVs in the EV cluster, this study selects seven kinds of EV charging data commonly available in the market for training and uses 6-kW EVs for testing. The test results are shown in Figure 6. It can be seen that zero-sample classification based on sparse coding can well identify the access of different types of EVs and has certain classification functions for unknown types of EVs. It is worth noting that the EV classification effect with a small power level difference is weaker than the EV classification effect with a large power level difference. Therefore, the classification effect of the {3kW, 3.3kW, 3.6kW} and {7kW, 7.2kW, 7.4kW} sets in Figure 6 is not very obvious.
Considering the classification problem between EVs and other devices, this study took REDD centralized electric appliance equipment and 3.3-kW type EVs as the training set to test the EVs of {6kW}. The classification effect is shown in Figure 7.
In order to verify the recognition effect of different EV type combination training sets on unknown EV test sets, this study selects typical types of EV combinations for testing. The test sets include from one type of EV to four types of EV combinations. The recognition effect is shown in Table 2. It can be seen from Table 2 that the more EV types there are, the better the recognition effect will be. In the case of a certain number of EV types, the more dispersed the EV power level is, the better the recognition effect will be.
To further verify the correctness of the conclusions above, this article studies the influence of the sample size of each EV type  training set on the recognition effect. The results are shown in Figure 8. It can be seen that the greater the number of samples in the training set, the more obvious the effect. At the same time, the performance tends to be stable when the sample size of the training set reaches 300.

EVs' Nonintrusive Decomposition
In order to verify the nonintrusive monitoring method of EVs proposed in this study, the decomposition effects of the traditional FHMM and the proposed method were compared. Figure 9 shows the nonintrusive identification effect of the traditional FHMM, in which Figure 9A shows the charging state of 120 charging piles, Figure 9B shows the charging power of charging piles obtained based on LSTM, and Figure 9C shows the total charging power of EVs decomposed based on the FHMM. The nonintrusive decomposition effect of EVs based on the method proposed in this study is shown in Figure 10. The charging states of EVs connected by charging piles is shown in Figure 10A, where the first 7 EVs are the charging status of known EVs, and the eighth is the charging status of unknown EVs.
Based on the decomposed EV charging state, the charging power of each type of EV can be obtained using Bi-LSTM. As shown in Figure 10B, the total power curve is synthesized according to the decomposed EV charging power. By comparing with Figure 9C, it can be seen that the nonintrusive decomposition of EVs proposed in this study has a higher precision.

CONCLUSION
In this study, the FHMM framework is used to develop a nonintrusive monitoring method based on ZSL. The charge-discharge characteristics of known EVs and unknown EVs connected to the charging pile were extracted by dictionary learning, and furthermore, the ZSL based on sparse coding was used to classify EVs, which could effectively identify the unknown EVs. In the validation process, the processed Pecan Street EV dataset was used for training and testing. Compared with the traditional FHMM, the nonintrusive decomposition of EVs proposed in this study has a higher accuracy.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.