*3.1. Data Preprocess*

During data collection, missing data, duplications and errors of electricity consumption data may occur. To avoid the adverse effects of faulty data on the electricity theft detection, reference [17] proposes an electricity data preprocessing method to recover the missing and erroneous data. Equation (8) represents the interpolation method to recover the mission data.

$$\mathbf{x}\_{d,t}^{\*} = \begin{cases} \frac{\mathbf{x}\_{d,t-1} + \mathbf{x}\_{d,t+1}}{2} & \mathbf{x}\_{d,t} \in \text{NaN}, \mathbf{x}\_{d,t-1}, \mathbf{x}\_{d,t+1} \notin \text{NaN} \\ 0 & \mathbf{x}\_{d,t} \in \text{NaN}, \mathbf{x}\_{d,t-1} \text{ or } \mathbf{x}\_{d,t+1} \in \text{NaN} \\ \mathbf{x}\_{d,t} & \mathbf{x}\_{d,t} \notin \text{NaN} \end{cases} \tag{8}$$

where *xd*,*<sup>t</sup>* is the electricity consumption data during time period *t* on day *d*. Additionally, NaN represents null and non-numeric character.

Moreover, the three-sigma rule of thumb [33] is used to recover the erroneous data as follows:

$$\mathbf{x}\_{d,t}^{\*} = \begin{cases} \text{avg}(\mathbf{x}\_d) + 2 \cdot \text{std}(\mathbf{x}\_d) & \text{if } \mathbf{x}\_{d,t} > \text{avg}(\mathbf{x}\_d) + 2 \cdot \text{std}(\mathbf{x}\_d) \\\ \mathbf{x}\_{d,t} & \text{otherwise} \end{cases} \tag{9}$$

where **<sup>x</sup>***d* is a vector composed of *xd*,*t*, avg(**x**) and std(**x**) stands for the average value and standard deviation value of vector **x**.

#### *3.2. Proposed Neural Network Structure Based on TextCNN*

As shown in Figure 6, the proposed neural network structure based on TextCNN is mainly composed of convolutional layers, pooling layers and fully-connected layers. The features of each layer are demonstrated in detail below.

**Figure 6.** Proposed network structure for electricity theft detection.
