
To address the challenge of low accuracy in traditional short-term electric load forecasting methods, this study proposes a novel forecasting framework, MSCSO-CNN–BiLSTM–Attention. The model integrates a Convolutional Neural Network (CNN), a Bidirectional Long Short-Term Memory (BiLSTM) network, and an Attention mechanism to effectively capture and model complex temporal dependencies in load data. The CNN is employed to extract local temporal features, which are then processed by BiLSTM to learn long-term dependencies. Subsequently, an Attention mechanism is introduced to assign adaptive weights to the BiLSTM outputs, thereby enhancing the model’s focus on critical time steps. However, the forecasting performance of CNN–BiLSTM–Attention is highly sensitive to hyperparameter settings, and the training process is computationally demanding. To address these issues, this paper introduces an enhanced or Modified Sand Cat Swarm Optimization (MSCSO) algorithm, which incorporates a triangular walk strategy and lens imaging opposition-based learning, to optimize the model’s hyperparameters efficiently. The optimization capability of MSCSO is validated on the CEC 2022 benchmark suite under simulated complex environments. The proposed model is further evaluated using the 2018 electric load dataset from a region in New Gran. Experimental results indicate that the MSCSO-CNN–BiLSTM–Attention model significantly outperforms existing approaches, achieving a forecasting accuracy of 98.68%. Compared with the baseline CNN–BiLSTM–Attention model, the proposed method reduces MAPE by 4.39%, RMSE by 386.30 MW, and MAE by 234.08 MW while improving the R2 score by 10.74%. The model also demonstrates superior fitting performance and generalization ability, highlighting its effectiveness for short-term electric load forecasting.