# Battery Life Prediction for Ensuring Robust Operation of IoT Devices in Remote Metering
## 3 Remote Metering Life Prediction Method
### C-SDFormer Model for Predicting the Discharge Capacity of MSD Primary Battery  
Our objective is to predict the discharge capacity in real-time using deep learning techniques, with input parameters including voltage, temperature, and communication count. To achieve this, we employed a transformer-based model, which represents an evolution of the seq2 seq model [24], featuring an encoder-decoder architecture. Diverging from traditional recurrent architectures [25; 26; 27], the transformer model relies on a neural network with an attention mechanism to analyze the relationships between outputs based on the voltage drop characteristics occurring during communication. While transformer models are predominantly used in natural language processing [28], they also find utility in analyzing time series data [29; 30; 31; 32]. To predict the discharge capacity during the first discharge stage, we introduce the C-SDFormer model, which builds upon the encoder architecture of the Transformer [33]. Unlike conventional Transformer models, C-SDFormer is specifically designed to handle the unique challenges posed by transient voltage fluctuations in remote metering environments. Traditional models struggle to effectively capture these variations, particularly those induced by communication events. To address this, C-SDFormer integrates mechanisms to differentiate between short-term fluctuations and long-term discharge trends, making it more suitable for battery discharge prediction in practical applications. Prior research has utilized traditional convolutional neural networks (CNNs [15]) for local feature extraction, as well as long short-term memory networks (LSTMs [14]) and gated recurrent units (GRUs [17]) for time series forecasting. However, these models exhibit limitations in capturing long-range dependencies and tend to suffer from vanishing gradients when processing extended sequences. Transformer-based models have emerged as a powerful alternative due to their capability to model long-term dependencies through  
Figure 6: Process of determining the primary point. (**a**) The minimum of the second derivative indicates the primary point. (**b**) Location of the primary point in the discharge curve. (**c**) Truncated data before the primary point. self-attention mechanisms. Informer [29], Autoformer [30], and Fedformer [31] are notable Transformer-based architectures designed for time series forecasting. While these models improve efficiency and accuracy compared to RNN-based approaches, they are not explicitly optimized for battery discharge prediction in remote metering environments. C-SDFormer distinguishes itself from existing Transformer-based time series models through its series decomposition module, which separates trend and seasonal components to better capture transient voltage variations caused by communication activities. Additionally, the CNN-based feature extraction module enhances the representation of voltage changes by identifying spatial patterns in time-series data, making it particularly effective in detecting sudden voltage drops induced by communication events. Furthermore, the self-attention mechanism in the Transformer encoder dynamically weighs the importance of different time steps and refines the extracted features from the series decomposition and CNN modules. This allows the model to focus on the most relevant temporal dependencies and spatial patterns, enhancing its ability to capture both short-term fluctuations and long-term battery discharge trends. This hybrid approach ensures that both short-term and long-term voltage dynamics are modelled accurately, leading to improved battery discharge prediction. The architecture of C-SDFormer consists of several key components, including a CNN-based input embedding layer, a positional encoding layer, an encoder layer, a series decomposition, and a linear output layer. Figure 7 illustrates the detailed structure of C-SDFormer. Initially, the voltage, communication count, and temperature are obtained through a sliding window and stacked together.