Data-Driven EV Load Profiles Generation Using a Variational Auto-Encoder

Although the penetration of electric vehicles (EVs) in distribution networks can improve the energy saving and emission reduction effects, its random and uncertain nature limits the ability of distribution networks to accept the load of EVs. To this end, establishing a load profile model of EV charging stations accurately and reasonably is of great significance to the planning, operation and scheduling of power system. Traditional generation methods for EV load profiles rely too much on experience, and need to set up a power load probability distribution in advance. In this paper, we propose a data-driven approach for load profiles of EV generation using a variational automatic encoder. Firstly, an encoder composed of deep convolution networks and a decoder composed of transposed convolution networks are trained using the original load profiles. Then, the new load profiles are obtained by decoding the random number which obeys a normal distribution. The simulation results show that EV load profiles generated by the deep convolution variational auto-encoder can not only retain the temporal correlation and probability distribution nature of the original load profiles, but also have a good restorative effect on the time distribution and fluctuation nature of the original power load.


Introduction
With the increasingly serious environmental and energy problems, electric vehicles (EVs) have attracted more and more attention because of their enormous advantages in energy saving and emission reduction.The stochastic nature of EVs has brought new challenges to the scheduling, operation, and planning of distribution management systems.Since EV loads are strongly stochastic, how to accurately model the uncertainty of EV loads has become a hot issue.Stochastic scenario generation is a widely used approach to describe the uncertainties of EV loads.By considering a series of different EV load profiles, the distribution management system can take uncertainty into account when making decisions, such as safe operation of distribution network, optimal economic trade and cooperative scheduling strategy.
Although scholars have proposed many methods for load profile generation of EV loads, there are still many problems to be solved.For example, most of the proposed methods are based on probabilistic models [1][2][3][4].These models are not able to accurately describe the true data distribution of the EV loads.The sampling from the high-dimensional distribution leads to a complex process.They are not able to take into account the time-varying, dynamic character and the complex temporal correlation of EV loads.In addition, probabilistic models require a large number of sampling to produce various load profiles.Common sampling methods include Monte Carlo sampling and Latin hypercube sampling.In order to improve the sampling efficiency, some scenario reduction algorithms such as backward reduction, forward selection, and scenario tree construction have been proposed [5].However, these methods not only exacerbate the complexity of probabilistic models, but also limit the diversity of generated load profiles.
Recently, as an important subsidiary of machine learning, the deep learning has become one of the most active technologies in many research fields, including image recognition, fault detection, load forecasting, data generation and so on.Especially, the variational auto-encoder (VAE), which was originally introduced by Kingma et al [6], has received enormous attention in the realm of data generation.Effective applications based on VAE have been reported in many areas such as noise reduction [7], dimensionality reduction [8][9][10] and data generation [11,12].At present, the application of VAE in data generation mainly focuses on generating MNIST handwritten digits and face images.To the best of our knowledge, there is no report about stochastic scenario generation of EV loads profiles using VAE.
In this paper, it is aimed to overcome these difficulties of generating EV load profiles.This approach has two key advantages: Firstly, the new approach is entirely data-driven.They don't need to sample the data in large quantities to fit the probability distribution, which greatly improves the efficiency of EV load profiles generation.The generated EV loads is diverse, and they preserve the temporal correlation between EV loads.Secondly, VAE belongs to unsupervised learning, which does not require labelled large data manually.The rest of this paper is organized as follows: Section 2 provides the background about EV load profile generation.Section 3 proposes and describes the VAE model.Section 4 discusses the simulations and results.The conclusions are described in Section 5.

Literature Review
In the past, many scholars have proposed different probability distributions to generate EV loads based on some reasonable assumption.For example, Zhou et al. analyzed the charging characteristics of different types of EVs and proposed a probability model to simulate charging demand [13].The proposed methods can take amount of charging time may affect the charging start time.Simulation showed that the load on weekends is smaller than that on working days during the day and night EV charging peaks.In [14], the authors assumed that the distance travelled by all EVs was fixed every day.In [15], all EVs were allocated a certain percentage and a probability distribution was built to simulate the power consumption of light-duty plug-in EVs under uncontrolled and controlled charging scenarios.In [16,17], the proposed methods simulate load profiles according to different driving patterns and vehicle usage data.Lopes et al. assumed that each EV travels a certain distance and consumes the corresponding power load [18,19].However, it is hard to capture the time-varying and dynamic character of EV loads by first and second order statistics alone.Generally speaking, these methods require that the travel habits of electric vehicles specify or fit the probability distribution of EV load profiles.Whether the hypothesis of probabilistic model is reasonable or not is directly related to the usability of the generated EV load profiles.Since daily routines and the lifestyle are varied [20][21][22], there is generally no unique or canonical distribution type suitable for modeling EV loads.
Another popular way to generate EV loads profile is to use time series.Amini et al. proposed the probabilistic hierarchical EVs' parking lot demand modeling and autoregressive moving average model to forecast the EV loads [23].A Time Series Model is applied to approximate the load profile for a parking lot in [24].In [25], time-series seasonal autoregressive integrated moving average (ARIMA) models are used for modeling and generating EVs electrical loads.Despite simple to implement, these Energies 2019, 12, 849 3 of 15 methods are easy to overfitting.Since they simply memorize the training data, the generated EV loads is highly similar to historical data, making it difficult to generate many different types of load data.
Deep learning technology has been widely used to generate data in recent years.The generative adversarial network (GAN) is designed to generate wind power data in [26].The simulation result shows that the generative adversarial network is able to generate realistic wind and photovoltaic power profiles with full diversity of behaviors.Similarly, the Bayesian generative adversarial network is applied to generate solar scenarios by using Bayesian probabilities in [27].Wan et al. proposed a VAE-based synthetic data generation method for imbalanced learning.The VAE has better performance than the traditional synthetic sampling methods [28].To extend reproduction of demonstration motion, the VAE is applied to generate time-series data in [29,30].Although GAN has shown great success in the realistic data generation, the training is not easy.For example, it's hard to achieve Nash equilibrium.Compared with GAN, the training process of VAE is easier.In addition, VAE can directly compare the difference between generated data and original data, but GAN cannot do so.VAE has been widely used to generate two-dimensional data such as MNIST handwritten digits and face images, but the applications on one-dimensional data generation are relatively limited.
Taking the above analysis into consideration, it is clear that though the predecessors have made great success for load profiles generation of EVs.There are still some problems to be solved.For example, how to design a new approach which can capture time-varying and dynamic characteristics without specifying probability distribution manually?How to avoid constant sampling and improve the efficiency of the algorithm?How to generate different types of EV loads instead of simply remembering historical data?
In order to address these issues, a novel approach based on VAE framework is proposed to generate stochastic scenario of EV loads profiles.The key contributions of this paper can be summarized as follows: (1) New technique: It is the first time in this paper to explore the feasibility of VAE in the application of load profiles generation for EVs.By employing VAE, we can generate load profiles which capture the time-varying and dynamic nature of EV loads.(2) Simple implement: Unlike traditional methods, the proposed approach can automatically learn the inherent nature of the EV loads, without the need to manually specify the probability distribution, which is suitable for generating EV loads of different time and space.In addition, it does not require a large number of samples to fit the probability distribution, which improves the efficiency of the algorithm.(3) Conditional load profiles generation: The proposed approaches provide two ways to generate conditional load profiles with specific characteristics.The first method uses the specified load data as the VAE input to generate the conditional load profiles.Another method takes the normal distribution data as the input of the decoder, and the decoder generates a large number of load profiles.Then, the load profiles are classified according to the characteristics, so as to get the required conditional load profiles.

Methodology
This part mainly introduces the following four sections: the principle of VAE, the method of generating conditional load profiles, the basic steps of the approaches and the indicators for evaluating results.

Variational Auto-Encoder
As one of the automatic encoders, the variational auto-encoder obtains a generator which can generate similar data to the original load through limited training samples.The conventional automatic encoder takes the original data as an input and compresses the input data by the encoder.Then, the generated new data is acquired by the decoder.In other words, if a conventional automatic encoder wants to generate N load profiles, N original load profiles are required as inputs.In this case, the style and number of generated data by the traditional automatic encoder are limited by the original data, so it is difficult to generate different styles of data, and the structure of the generated data is single.To overcome the shortcomings of traditional automatic encoder, the variational auto-encoder adds noise data that satisfy normal distribution to the latent variable of the encoder, and then takes the two variables as the input of the decoder to generate the new data.
Normally, the VAE is designed to learn the data distribution p θ (X) of original load profiles according to power load time series X = x 1 , . . ., x n .Typically, this data distribution of EV loads is decomposed as follows: Therefore, inference is difficult to carry out.We have to estimate this function approximately by q φ (z|x ) and set of parameters φ.
We need to approximate log p θ (x i ), because the data that follow this distribution cannot be sampled directly.To this end, we can combine the variational lower bound and the Kullback-Leibler divergence: Because we are calculating the difference between the true posterior p θ (z|x ) and the approximate q φ (z|x ), considering that this divergence is bigger than 0, then term L(θ, φ; x) acts as a lower bound of the log likelihood: That could be written as: where the first term related to the KL-divergence constrains the function q φ (z|x ) to the shape of the p θ (z).The second term can reconstruct the input with a given latent variable z that follows p θ (x|z ).
Using this loss function, we are able to parameterize the model as follows: p θ (x|z ) = p(x; g(z, θ)) (10) where f and g are deep neural networks with the set of parameters θ and φ, respectively.More details can be found in the [31].The back propagation algorithm can be used to re-parameterize the generation of the vector z.
The key advantage of VAE that we can use some samples to train it in an unsupervised way, and then encode EV load profiles in the latent space without any effort.Once the origin load profiles are encoded, we can modify them in this space, and then reconstruct or decode the altered vector to get some new load profiles.A standard structure of variational auto-encoder is shown in Figure 1.
the ( ) p z θ .The second term can reconstruct the input with a given latent variable z that follows Using this loss function, we are able to parameterize the model as follows: where f and g are deep neural networks with the set of parameters θ andφ , respectively.More details can be found in the [31].The back propagation algorithm can be used to re-parameterize the generation of the vector z.
The key advantage of VAE that we can use some samples to train it in an unsupervised way, and then encode EV load profiles in the latent space without any effort.Once the origin load profiles are encoded, we can modify them in this space, and then reconstruct or decode the altered vector to get some new load profiles.A standard structure of variational auto-encoder is shown in Figure 1.The encoder encodes the load profiles into the latent space and outputs two vectors describing the mean and variance of the latent state distributions.Then, the decoder model will generate a latent vector by sampling from these defined distributions and proceed to develop a reconstruction of the original input.

K-nearest Neighbor Algorithms
The VAE trains the depth convolution network using the original power load profiles, and then takes the random number obeying the normal distribution as the input of the decoder to get the new power load.The types of load profiles generated are various, so we need to process them further to obtain the label load profiles.In this paper, we will use the k-nearest neighbor algorithm (KNN) to classify the generated load profiles, so as to get the conditional load profiles.
The k-nearest neighbor algorithm is a non-parametric method widely used for classification.The input of KNN includes k closest training examples in the feature space and the output of KNN is a class membership.An object is classified by a majority vote of its neighbors and the object will be assigned to the class most common among its k nearest neighbors.The KNN can be implemented by following the below steps: 1) Load the data and initialize the value of k.The encoder encodes the load profiles into the latent space and outputs two vectors describing the mean and variance of the latent state distributions.Then, the decoder model will generate a latent vector by sampling from these defined distributions and proceed to develop a reconstruction of the original input.

K-nearest Neighbor Algorithms
The VAE trains the depth convolution network using the original power load profiles, and then takes the random number obeying the normal distribution as the input of the decoder to get the new power load.The types of load profiles generated are various, so we need to process them further to obtain the label load profiles.In this paper, we will use the k-nearest neighbor algorithm (KNN) to classify the generated load profiles, so as to get the conditional load profiles.
The k-nearest neighbor algorithm is a non-parametric method widely used for classification.The input of KNN includes k closest training examples in the feature space and the output of KNN is a class membership.An object is classified by a majority vote of its neighbors and the object will be assigned to the class most common among its k nearest neighbors.The KNN can be implemented by following the below steps: (1) Load the data and initialize the value of k.
(2) Calculate the Euclidean distance between test load profiles and each row of training load profiles.
(3) Sort the calculated distances in ascending order based on distance values.(4) Get top k rows from the sorted array.
(5) Get the most frequent class of these rows.

Indicators for Evaluating Results
Unlike load power forecasting, the generated power load is not required to be exactly the same as the actual power load in each time interval.In order to evaluate the similarity between the generated load profiles and the actual load profiles, this paper will verify the validity of the generated load Energies 2019, 12, 849 6 of 15 profiles from four aspects: probability distribution of power loads, the temporal correlation of power loads, duration of power loads and volatility of power loads: (1) Probability distribution of power loads: The power load is divided into several intervals, and the number of load data falling in each interval is calculated.Then, the ratio of the number of loads in each interval to the total load is calculated, and the corresponding probability histogram or the probability distribution of power loads is obtained by connecting the scattered points.(2) The temporal correlation of power loads: Here autocorrelation function will be utilized to evaluate the temporal correlation of power loads since it's the most popular method.It is required that the temporal correlation between the generated power load profiles and the original power load profiles be consistent.The mathematical formula of autocorrelation function is as follows: where µ is the mean of X t ; σ is standard deviation; τis the lag time.
(3) Duration of power loads: The duration of load power indicates the running time when the power load is greater than a certain value.The duration of power load can be expressed as follows: where: P i represents item i of the power load time series; n represents the total length of load time series; m is the number of intervals of load profiles; q i,j is a variable used to count variables; t j is the total time when the load is greater than P j .
(4) Volatility of power loads: In order to evaluate the volatility of power load, the absolute values of the two adjacent power load differences are calculated first, and then the probability distributions of these absolute values are calculated.

Procedures of Generating Load Profiles Based on VAE
According to the above analysis, the produce of EV load profiles generation using variational auto-encoder is as follows: (1) Data normalization: The data of load profiles needs to be normalized before the data is assigned to the encoder, otherwise the loss function may not converge.In this paper, the min-max normalization method will be used to transform the input data into the interval [0,1].(2) Coding the load profiles: The encoder constructed by deep convolution network maps the input data to the low dimensional vector space.(3) Sampling data: According to the mean and variance of the encoder output, some random number obeying the normal distribution is generated, and they will be used as the input of the decoder.(4) Decoding data: Taking the data of the sampling layer as input, the new load profiles can be obtained by the decoder composed of the deep transposed convolution network.(5) Gradient back propagation: The loss function is calculated using the output data from the decoder and the original load data.Then, the back-propagation method will be utilized to continuously adjust the weights and thresholds.(6) Generating load profiles: After the iteration, we can use the trained VAE to generate new load profiles.The proposed approaches provide two ways to generate new load profiles.The first method uses the specified load data as the VAE input to generate the conditional load profiles.Another way takes the normal distribution data as the input of the decoder, and the decoder generates a large number of load profiles.Then, the load profiles are classified by KNN, so as to get the required conditional load profiles.

Parameters and Structure
It assumes that EVs mainly include the following five classes: Battery EV without demand response (BEV_NODR), Battery EV with demand response (BEV_DR), Plug-in hybrid EV without demand response (PHEV_NODR), Plug-in hybrid EV with demand response (PHEV_DR) and the above four hybrid EVs (HYEV).
The modeling details of the load curves for these EVs are shown in [32][33][34][35][36].It assumes that they charge and discharge in a charging station.The typical load profiles of the 5 classes' EVs are shown in Figure 2. The load profiles are recorded every 10 minutes, so there are 144 points per load profiles.All approaches are implemented on a laptop with a 2.4 GHz Intel i3 processor and 6 GB of memory using the Keras library with Theano backend.All weights of network are initialized from a zero-centered normal distribution.The VAE is trained with mini-batch Adam with a mini-batch size of 50.After testing the parameters of different structures and parameters, the optimal structure and parameters are as follows: first method uses the specified load data as the VAE input to generate the conditional load profiles.Another way takes the normal distribution data as the input of the decoder, and the decoder generates a large number of load profiles.Then, the load profiles are classified by KNN, so as to get the required conditional load profiles.

Parameters and Structure
It assumes that EVs mainly include the following five classes: Battery EV without demand response (BEV_NODR), Battery EV with demand response (BEV_DR), Plug-in hybrid EV without demand response (PHEV_NODR), Plug-in hybrid EV with demand response (PHEV_DR) and the above four hybrid EVs (HYEV).
The modeling details of the load curves for these EVs are shown in [32][33][34][35][36].It assumes that they charge and discharge in a charging station.The typical load profiles of the 5 classes' EVs are shown in Figure 2. The load profiles are recorded every 10 minutes, so there are 144 points per load profiles.All approaches are implemented on a laptop with a 2.4 GHz Intel i3 processor and 6GB of memory using the Keras library with Theano backend.All weights of network are initialized from a zero-centered normal distribution.The VAE is trained with mini-batch Adam with a mini-batch size of 50.After testing the parameters of different structures and parameters, the optimal structure and parameters are as follows: The input load profiles consist of 144 values reconstructed into a 12 × 12 × 1 data matrix.We construct four convolutional layers in the encoder network.The convolution kernel size of convolution layer 1 is 2 × 2 and convolution stride is 1.The convolution kernel size of convolution layer 2 is 2 × 2 and convolution stride is 2. The convolution kernel size of convolution layer 3 and layer 4 is 3 × 3 and convolution stride is 1.Each convolutional layer is followed by a batch normalization layer and a ReLU activation function.In order to sample latent variable z and calculate the KL divergence loss, two fully-connected   The input load profiles consist of 144 values reconstructed into a 12 × 12 × 1 data matrix.We construct four convolutional layers in the encoder network.The convolution kernel size of convolution layer 1 is 2 × 2 and convolution stride is 1.The convolution kernel size of convolution layer 2 is 2 × 2 and convolution stride is 2. The convolution kernel size of convolution layer 3 and layer 4 is 3 × 3 and convolution stride is 1.Each convolutional layer is followed by a batch normalization layer and a ReLU activation function.In order to sample latent variable z and calculate the KL divergence loss, two fully-connected layers for mean and variance are added to encoder.For decoder, we use 4    This section mainly consists of the following three points: 1) Visualizing the natural load profiles based on the similarity of their latent representations.2)The load profiles are generated, and the similarity between the new load profiles and the original load profiles are evaluated by the proposed indicators.3)The conditional load profiles are generated by two ways, and the performance is evaluated.

Visualization of Latent Vectors
In addition to directly observing the results of the generated load profiles by using the proposed four indicators, there is another way to evaluate the new load profiles.We can observe the empirical distribution of generated load profiles by sampling latent vectors.The latent vectors are the encoding representation of the natural load profiles.According the similarity of latent representations, we are

Visualization of Latent Vectors
In addition to directly observing the results of the generated load profiles by using the proposed four indicators, there is another way to evaluate the new load profiles.We can observe the empirical distribution of generated load profiles by sampling latent vectors.The latent vectors are the encoding representation of the natural load profiles.According the similarity of latent representations, we are able to visualize the natural load profiles.The principle of the approaches is shown in Figure 4, and the two steps to implement the approaches are as follows: (1) It assumes that the dimension of the latent vectors is 2.Then, the generated load profiles are mapped to 2-dimensional spaces, which make it more convenient to visualize.(2) Since the dimension of the latent vectors is 2, we can sample a batch of data at equal intervals from the two-dimensional space, which can represent the empirical distribution of the latent vectors in the whole two-dimensional space.Then, the sampled data is processed by the decoder, and the new load profiles can be obtained.
The visualization of 15 × 15 load profiles is shown in Figure 5.
encoder; and, (b) Architecture and parameters of decoder.
This section mainly consists of the following three points: 1) Visualizing the natural load profiles based on the similarity of their latent representations.2)The load profiles are generated, and the similarity between the new load profiles and the original load profiles are evaluated by the proposed indicators.
3) The conditional load profiles are generated by two ways, and the performance is evaluated.

Visualization of Latent Vectors
In addition to directly observing the results of the generated load profiles by using the proposed four indicators, there is another way to evaluate the new load profiles.We can observe the empirical distribution of generated load profiles by sampling latent vectors.The latent vectors are the encoding representation of the natural load profiles.According the similarity of latent representations, we are able to visualize the natural load profiles.The principle of the approaches is shown in Figure 4, and the two steps to implement the approaches are as follows: 1) It assumes that the dimension of the latent vectors is 2.Then, the generated load profiles are mapped to 2-dimensional spaces, which make it more convenient to visualize.2) Since the dimension of the latent vectors is 2, we can sample a batch of data at equal intervals from the two-dimensional space, which can represent the empirical distribution of the latent vectors in the whole two-dimensional space.Then, the sampled data is processed by the decoder, and the new load profiles can be obtained.
The visualization of 15 × 15 load profiles is shown in Figure 5.We can see that load profiles with similar shapes tend to be clustered as a group.A variety of different classes of load profiles appear in this two-dimensional plane, and there are some transitional regions between different classes of load profiles.The load profiles in the transition area have a variety of load characteristics, and the profiles of these power loads are similar.

Generating Load Profiles
To verify the effectiveness of the proposed algorithm, we assume that there are 20-60 HYEV per day at a charging station.Nine thousand (9000) load profiles are obtained through simulation.Among them, 8000 load profiles are randomly selected as the training set, and the remaining data is used as the test set.To illustrate the effectiveness of the proposed approaches, we will compare the performance of VAE and GAN networks.The parameters of GAN are as follows: the input of the generator is random noise with dimension 50.The generator consists of three full-connected layers, and the number of neurons is 48, 96 and 144, respectively.The discriminator also consists of three layers of full-junction layers, with 94, 48 and one neuron, respectively.The performance of original We can see that load profiles with similar shapes tend to be clustered as a group.A variety of different classes of load profiles appear in this two-dimensional plane, and there are some transitional regions between different classes of load profiles.The load profiles in the transition area have a variety of load characteristics, and the profiles of these power loads are similar.

Generating Load Profiles
To verify the effectiveness of the proposed algorithm, we assume that there are 20-60 HYEV per day at a charging station.Nine thousand (9000) load profiles are obtained through simulation.Among them, 8000 load profiles are randomly selected as the training set, and the remaining data is used as the Energies 2019, 12, 849 10 of 15 test set.To illustrate the effectiveness of the proposed approaches, we will compare the performance of VAE and GAN networks.The parameters of GAN are as follows: the input of the generator is random noise with dimension 50.The generator consists of three full-connected layers, and the number of neurons is 48, 96 and 144, respectively.The discriminator also consists of three layers of full-junction layers, with 94, 48 and one neuron, respectively.The performance of original load profiles and the generated load profiles are shown in Figures 6-10.
of load characteristics, and the profiles of these power loads are similar.

Generating Load Profiles
To verify the effectiveness of the proposed algorithm, we assume that there are 20-60 HYEV per day at a charging station.Nine thousand (9000) load profiles are obtained through simulation.Among them, 8000 load profiles are randomly selected as the training set, and the remaining data is used as the test set.To illustrate the effectiveness of the proposed approaches, we will compare the performance of VAE and GAN networks.The parameters of GAN are as follows: the input of the generator is random noise with dimension 50.The generator consists of three full-connected layers, and the number of neurons is 48, 96 and 144, respectively.The discriminator also consists of three layers of full-junction layers, with 94, 48 and one neuron, respectively.The performance of original load profiles and the generated load profiles are shown in Figures 6-10.   of load characteristics, and the profiles of these power loads are similar.

Generating Load Profiles
To verify the effectiveness of the proposed algorithm, we assume that there are 20-60 HYEV per day at a charging station.Nine thousand (9000) load profiles are obtained through simulation.Among them, 8000 load profiles are randomly selected as the training set, and the remaining data is used as the test set.To illustrate the effectiveness of the proposed approaches, we will compare the performance of VAE and GAN networks.The parameters of GAN are as follows: the input of the generator is random noise with dimension 50.The generator consists of three full-connected layers, and the number of neurons is 48, 96 and 144, respectively.The discriminator also consists of three layers of full-junction layers, with 94, 48 and one neuron, respectively.The performance of original load profiles and the generated load profiles are shown in Figures 6-10.The load profiles generated in Figure 6 are randomly selected.Then, the dynamic time warping distance between each load profile in the test set and the generated load profile is calculated.Finally, the true load profile with minimum dynamic time warping distance is selected.It can be seen from the Figure 6 that the generated load profiles are very similar to the true load profiles that did not participate in the training process, which shows that the generated data are very close to the true data.Figure 7 shows the probability density functions for 8000 training sets and the generated load profiles drawn by ksdensite function in MATLAB2018a.Obviously, the probability of each power load appearing is similar in the generated load profile and the original load profile, which shows that the proposed methods can well fit the probability distribution of the original power load.In addition, it can be found from above Figures that the load profiles generated by VAE is closer to the true profiles than that generated by GAN.
In order to analyze the time characteristics of the generated load profiles, Figure 8 shows the autocorrelation function of the load profile for a week that is randomly selected, and Figure 9 is the duration of the power loads.The load profiles generated in Figure 6 are randomly selected.Then, the dynamic time warping distance between each load profile in the test set and the generated load profile is calculated.Finally, the true load profile with minimum dynamic time warping distance is selected.It can be seen from the Figure 6 that the generated load profiles are very similar to the true load profiles that did not participate in the training process, which shows that the generated data are very close to the true data.Figure 7 shows the probability density functions for 8000 training sets and the generated load profiles drawn by ksdensite function in MATLAB2018a.Obviously, the probability of each power load appearing is similar in the generated load profile and the original load profile, which shows that the proposed methods can well fit the probability distribution of the original power load.In addition, it can be found from above Figures that the load profiles generated by VAE is closer to the true profiles than that generated by GAN.
In order to analyze the time characteristics of the generated load profiles, Figure 8 shows the autocorrelation function of the load profile for a week that is randomly selected, and Figure 9 is the duration of the power loads.The autocorrelation functions of true load and generated loads are similar, which implies that the generated load profiles have the same temporal correlation as the original load profiles.It can be seen from Figure 9 that the generated load profile and the actual load profile and the area enclosed by the y-axis are approximately equal, which indicates that the VAE well restores the power demand of the EV charging station for one week.
Further, Figure 10 shows the probability density function of the load variation per hour.Obviously, the fluctuation of the simulated load profile is almost the same as the real situation, which further illustrates the effectiveness of the proposed approaches.
As far as the autocorrelation function, duration of load profiles, load variation and probability density function are concerned, VAE can imitate the real load profiles well, which is slightly better than GAN.The autocorrelation functions of true load and generated loads are similar, which implies that the generated load profiles have the same temporal correlation as the original load profiles.It can be seen from Figure 9 that the generated load profile and the actual load profile and the area enclosed by the y-axis are approximately equal, which indicates that the VAE well restores the power demand of the EV charging station for one week.
Further, Figure 10 shows the probability density function of the load variation per hour.Obviously, the fluctuation of the simulated load profile is almost the same as the real situation, which further illustrates the effectiveness of the proposed approaches.
As far as the autocorrelation function, duration of load profiles, load variation and probability density function are concerned, VAE can imitate the real load profiles well, which is slightly better than GAN.

Conditional Load Profiles Generation
The VAE offers two methods to generate conditional load profiles.The first method takes the original loads as input and obtains new load profiles through the VAE model.Another method is to take the data obeying the normal distribution as an input and obtain new load profiles through the decoder model.To test the performance of these two methods, we assume that there are four classes' electric cars per day at a charging station.In addition, it assumes that the number of BEV_NODR is a random number ranges from 40 to 70.The number of BEV_DR is a random number ranges from 30 to 50.The number of PHEV_NODR and PHEV_DR are a random number ranges from 20 to 50.9000 load profiles are obtained through simulation.Among them, 8000 load profiles are randomly selected as the training set, and the remaining data is used as the test set.After many testing, the parameter k of the K-nearest neighbor algorithms is assumed to be 30.The performance of original load profiles and the generated load profiles are shown in Figures 11-14

Conditional Load Profiles Generation
The VAE offers two methods to generate conditional load profiles.The first method takes the original loads as input and obtains new load profiles through the VAE model.Another method is to take the data obeying the normal distribution as an input and obtain new load profiles through the decoder model.To test the performance of these two methods, we assume that there are four classes' electric cars per day at a charging station.In addition, it assumes that the number of BEV_NODR is a random number ranges from 40 to 70.The number of BEV_DR is a random number ranges from 30 to 50.The number of PHEV_NODR and PHEV_DR are a random number ranges from 20 to 50.9000 load profiles are obtained through simulation.Among them, 8000 load profiles are randomly selected as the training set, and the remaining data is used as the test set.After many testing, the parameter k of the K-nearest neighbor algorithms is assumed to be 30.The performance of original load profiles and the generated load profiles are shown in Figures 11-14.
random number ranges from 40 to 70.The number of BEV_DR is a random number ranges from 30 to 50.The number of PHEV_NODR and PHEV_DR are a random number ranges from 20 to 50.9000 load profiles are obtained through simulation.Among them, 8000 load profiles are randomly selected as the training set, and the remaining data is used as the test set.After many testing, the parameter k of the K-nearest neighbor algorithms is assumed to be 30.The performance of original load profiles and the generated load profiles are shown in Figures 11-14.50.The number of PHEV_NODR and PHEV_DR are a random number ranges from 20 to 50.9000 load profiles are obtained through simulation.Among them, 8000 load profiles are randomly selected as the training set, and the remaining data is used as the test set.After many testing, the parameter k of the K-nearest neighbor algorithms is assumed to be 30.The performance of original load profiles and the generated load profiles are shown in Figures 11-14     Obviously, the probability density function of the load profiles generated by the first method is highly consistent with the probability density function of the true load profiles, which shows that the first method can produce the required label load profiles well.The number of new load profiles produced by the first method is limited by the number of real loads.In other words, the number of conditional load profiles generated is less than or equal to the number of original conditional load profiles.In addition, the load profiles generated by the first method are highly similar to the input load profiles, and the type of new load profiles is limited.There is a certain deviation between the probability density function of the load profiles generated by the second method and that of the original load profiles, because some transition state profiles are also divided into conditional load profiles.Compared with the first method, the type of conditional load profiles produced by the second method is more abundant because of the existence of load profiles in transition state.Obviously, the probability density function of the load profiles generated by the first method is highly consistent with the probability density function of the true load profiles, which shows that the first method can produce the required label load profiles well.The number of new load profiles produced by the first method is limited by the number of real loads.In other words, the number of conditional load profiles generated is less than or equal to the number of original conditional load profiles.In addition, the load profiles generated by the first method are highly similar to the input load profiles, and the type of new load profiles is limited.There is a certain deviation between the probability density function of the load profiles generated by the second method and that of the original load profiles, because some transition state profiles are also divided into conditional load profiles.Compared with the first method, the type of conditional load profiles produced by the second method is more abundant because of the existence of load profiles in transition state.

Conclusions
It is of great practical significance for the operation, optimization and management of power Obviously, the probability density function of the load profiles generated by the first method is highly consistent with the probability density function of the true load profiles, which shows that the first method can produce the required label load profiles well.The number of new load profiles produced by the first method is limited by the number of real loads.In other words, the number of conditional load profiles generated is less than or equal to the number of original conditional load profiles.In addition, the load profiles generated by the first method are highly similar to the input load profiles, and the type of new load profiles is limited.There is a certain deviation between the probability density function of the load profiles generated by the second method and that of the original load profiles, because some transition state profiles are also divided into conditional load profiles.Compared with the first method, the type of conditional load profiles produced by the second method is more abundant because of the existence of load profiles in transition state.

Conclusions
It is of great practical significance for the operation, optimization and management of power systems to master the principle of potential load changes and generate data similar to historical loads.In this paper, a novel machine learning technique, the variational auto-encoder, is proposed to generate EV load profiles.The proposed approach can automatically learn the inherent nature of the EV loads, without the need to manually specify the probability distribution, which is suitable for generating EV loads of different time and space.Through simulation, we deduce the following conclusions: (1) Traditional methods mainly fit the EV load distribution manually according to the driving habits of electric vehicles.Since daily routines and lifestyle vary, there is generally no unique or canonical distribution type suitable for modeling EV loads.The proposed approach can automatically learn the inherent nature of the EV loads, without the need to manually specify the probability distribution, which is suitable for generating EV loads of different time and space.(2) By mapping the load profiles to 2-D space and sampling the latent vectors, it is found that similar load profiles are grouped into a class.There are some transition spaces between the two classes of load profiles, and the load profiles in the transition space have many characteristics of load profiles.(3) With the noise data obeying normal distribution as input, the load profiles similar to the original data can be obtained by the trained decoder.By comparing the generated load profiles with the real load profiles, it is found that VAE can not only accurately capture the temporal correlation and probability distribution characteristics of the original load profiles, but also preserve the volatility of the original load profiles.In addition, the power consumption of the generated load profiles and that of the original load profiles are also consistent over a period of time.(4) The proposed approaches provide two ways to generate conditional load profiles with specific characteristics.The probability density function of the load profiles generated by the first method is highly consistent with the probability density function of the true load profiles, which shows that the first method can produce the required label load profiles well.Compared with the first method, the second method can generate an infinite number of conditional load profiles, and the conditional load profiles are also richer in style.

Figure 2 .
Figure 2.Typical load profiles of five classes EV.Figure 2. Typical load profiles of five classes EV.

Figure 2 .
Figure 2.Typical load profiles of five classes EV.Figure 2. Typical load profiles of five classes EV.
and a convolutional layer.The transposed convolution kernel size of convolution layer 1 and layer 2 is 3 × 3 and convolution stride is 1.The transposed convolution kernel size of convolution layer 3 is 3 × 3 and convolution stride is 2. The convolution kernel size of convolution layer 1 is 2 × 2. We also use ReLU as the activation function and use batch normalization to help stabilize training.The details of architecture are shown in Figure3.

Figure 2 .
Figure 2.Typical load profiles of five classes EV.

Figure 3 .
Figure 3. Architecture and parameters of auto-encoder network.(a) Architecture and parameters of encoder; and, (b) Architecture and parameters of decoder.This section mainly consists of the following three points: (1) Visualizing the natural load profiles based on the similarity of their latent representations.(2) The load profiles are generated, and the similarity between the new load profiles and the original load profiles are evaluated by the proposed indicators.(3) The conditional load profiles are generated by two ways, and the performance is evaluated.

Figure 6 .
Figure 6.The true load profile and generated load profile.

Figure 7 .
Figure 7. Probability density functions of true load and generated load.

Figure 6 .
Figure 6.The true load profile and generated load profile.

Figure 6 .
Figure 6.The true load profile and generated load profile.

Figure 7 .
Figure 7. Probability density functions of true load and generated load.Figure 7. Probability density functions of true load and generated load.

Figure 7 .
Figure 7. Probability density functions of true load and generated load.Figure 7. Probability density functions of true load and generated load.

Figure 8 .
Figure 8.The autocorrelation function of load.Figure 8.The autocorrelation function of load.

Figure 8 .
Figure 8.The autocorrelation function of load.Figure 8.The autocorrelation function of load.

Figure 8 .
Figure 8.The autocorrelation function of load.

9 .
Duration of load profiles.

Figure 10 .
Figure 10.Probability density function of load variation.