## 4 Proposed Scheme
### Accurate Power Consumption Predictor  
The ability of the grid operator to manage energy in the smart grid is crucial for maintaining a stable and reliable electricity supply. Energy management systems require accurate predictions of future power consumption, which are achieved by collecting historical power consumption data at regular intervals and training machine learning models on this comprehensive dataset. These models identify and learn patterns and trends in the data to accurately forecast future energy needs. These forecasts offer valuable insights for energy providers, allowing them to plan for sufficient generation and transmission capacity and proactively mitigate the risk of power outages or disruptions. With this foresight, providers can optimize resource allocation and maintain a consistently reliable energy supply for their customers. Our proposed predictor architecture is illustrated in Figure 4. The input size for both the LSTM and transformer predictors is 48, representing the total number of readings per day, \(r_{t}\) up to \(r_{t+48}\). The predicted output is the subsequent reading, \(r_{t+49}\). Note that \(r_{t}\) to \(r_{t+48}\) are CAT readings reported by the SMs, while prediction (\(r_{t+49}\)) is an actual (non-CAT) reading. In the combined architecture of the LSTM and transformer, after each model generates its respective output, these outputs are concatenated by appending one to the other, resulting in an extended feature vector. This concatenated vector is then forwarded to the fully connected layer, which computes the final prediction \(r_{t+49}\). Note that the outputs do not need normalization or any form of scaling prior to being passed to the fully connected layer because they are power consumption readings and they have the same range of numbers. However, the CAT dataset, as discussed in Section 4.1, is not suitable for direct input into the predictor in its current form. It is organized such that 48 readings per day across 536 days are consolidated into a single continuous sequence. To prepare this dataset for use with our proposed deep learning models, it needs to be restructured into individual daily sequences, ensuring that each day's readings are formatted appropriately as separate inputs. In particular, the first 48 CAT readings (i.e., from reading \(r_{1}\) up to reading \(r_{48}\)) are passed to the model as the input sequence \(\mathbf{x}_{t}\), and the label \(\mathbf{y}_{t}\) is the 49 th non-CAT (actual) reading. This approach allows the model to predict the actual future readings using past CAT readings reported by the smart meters as input. In the subsequent time step, the CAT readings from reading \(r_{2}\) up to reading \(r_{49}\) are used as the input sequence \(\mathbf{x}_{t+1}\), with the label \(\mathbf{y}_{t+1}\) being the 50 th actual reading. Note that \(r_{49}\) in this case is the CAT reading reported by the smart meter and it is not the actual reading predicted by the model. This process continues iteratively for subsequent time steps. Designing an accurate predictor is a challenge for two main reasons: the presence of diverse patterns in consumption data and the noise introduced in the power consumption data due to using the CAT data collection approach. To address this challenge, we used a cluster-based prediction approach and carefully designed the predictor to be able to overcome the noise in the data. Specifically, the system operator groups consumers with similar power consumption patterns into clusters to overcome the problem of diverse consumption patterns in the data, thus reducing the prediction error. Clustering consumers by the system operator can practically be accomplished through the analysis of relevant metadata that directly influence electricity consumption. Such metadata can include details like the type of consumption (residential/non-residential), the size of the dwelling, the number of occupants, professions, and geographic location. However, the dataset used in this study did not contain this information.