$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
Dataset collection and description
The dataset (Figure 1) used in this research comprises historical records crucial for solar power forecasting. The dataset comprises daily operational data from a 50 MW concentrated solar thermal plant operated by Megha Engineering and Infrastructures Limited (MEIL), located near Anantapur, Andhra Pradesh, India, utilizing parabolic trough Concentrating Solar Power(CSP) technology that captures Direct Normal Irradiance (DNI) and transfers heat via a Heat Transfer Fluid (HTF) to generate electricity. The dataset was collected from 01 January 2015 to 03 October 2025 and contains seven key attributes that capture temporal information, solar irradiance measurements, and power generation output. The temporal attributes include 'Date', providing the calendar date in standard format, 'Year' indicating the year of data collection, 'Month' representing the month number, 'Day' denoting the day of the month, and 'Julian Day' offering a sequential day numbering system throughout the year for continuous temporal analysis. The primary meteorological input variable is 'DNI SUM' measured in kWh/m², which represents the total Direct Normal Irradiance (DNI), the cumulative solar energy received per square meter of the collector surface, serving as the critical factor influencing CSP plant thermal conversion efficiency. The target variable 'Actual Generation', measured in kWh, captures the electrical power output produced by the CSP plant, reflecting the result of the solar-to-thermal-to-electrical energy conversion process. These attributes collectively enable comprehensive analysis of plant performance, including thermal efficiency determination, DNI-to-power conversion modeling, identification of atmospheric and cloud cover influences through spectral analysis, implementation of zero-error correction protocols for sensor calibration, and development of advanced hybrid machine learning forecasting models for optimizing real-time operational planning and enhancing overall CSP plant efficiency and reliability. Plant details available at: https://solarpaces.nrel.gov/project/megha-solar-plant

Figure 1: Top five rows of the dataset. Sample data showing the initial entries of the solar power generation dataset, displaying input features and target variables used for model training and evaluation. Please click here to view a larger version of this figure.
Data preparation
The study utilizes solar generation time-series data spanning from 01 January 2015 to 10 March 2025. To account for potential data quality issues in early years and focus on more recent patterns, the records were filtered from 01 January 2017 onward. Temporal columns (Date, Year, Day) were removed based on preliminary correlation analysis showing negligible predictive value. Missing values were imputed using a moving average technique to maintain temporal continuity while minimizing distortion of underlying patterns. Three lag features were created using the target variable (Actual Generation (kW/h)) to capture temporal dependencies.
Dataset splitting
To establish balanced and representative training, validation, and test cohorts, the pre-processed dataset was segmented using a stratified sampling method. This approach ensured that 70% of the data (2091 data) were allocated for training, while both validation and test sets each comprised 15% (448 data per set).
Data normalization
Features were standardized using StandardScaler, while target values were normalized via MinMaxScaler to [0,1] range for neural network stability.
Model training
Five hybrid models (Random Forest-BiLSTM, CNN-LSTM, CNN-BiLSTM, CNN-GRU, and CNN-Transformer) were implemented for solar generation forecasting. The input data was restructured into a sequential format reshaped as (samples, timesteps, features) where timesteps = 1 for most models, except CNN-LSTM, which used a sliding window of 15 steps. Training, validation, and test sets were scaled while preserving temporal order to avoid data leakage. All models are trained with 32 batch-size and 30 epochs.
Random Forest-BiLSTM (Figure 2): The proposed hybrid model combines a Bidirectional Long Short-Term Memory (BiLSTM) network with a Random Forest (RF) regressor to improve prediction accuracy. First, the BiLSTM model is trained on the input time-series data to capture temporal patterns and generate initial predictions. After this, the residual errors (differences between actual and predicted values) from the BiLSTM are calculated. A Random Forest model is then trained on the original input features to learn and predict these residuals. To enhance the performance of the RF model, the six most important features are selected based on feature importance scores. Finally, the corrected prediction is obtained by adding the RF-predicted residuals to the BiLSTM outputs. This hybrid approach leverages the sequence modeling ability of BiLSTM and the ensemble learning strength of Random Forest to achieve better generalization and predictive performance.
Let
be the input sequence at time step t.
BiLSTM Prediction:
,
Residual Computation:
Residual Learning using Random Forest: Let Z⊂X be the top-k features selected using feature importance.
Final Prediction:

Figure 2: Architecture of Random Forest-Bidirectional Long Short-Term Memory model. Schematic diagram illustrating the RF-BiLSTM hybrid architecture, showing the integration of Random Forest feature processing with bidirectional LSTM layers for temporal sequence learning. Please click here to view a larger version of this figure.
CNN-LSTM (Figure 3): The CNN-LSTM hybrid model begins by processing the input sequence using a 1D Convolutional layer to extract local spatial features, followed by a LeakyReLU activation, batch normalization, and max pooling. The extracted features are then passed through a stack of three LSTM layers to learn temporal dependencies, with layer normalization and dropout applied after the first two LSTMs for regularization. The final LSTM output is passed through fully connected dense layers with activation and dropout and finally mapped to the output using a single neuron.
Let
be the input sequence, where T is the time window and F is the number of features.
CNN operation:
Max pooling:
LSTM cell:
![figure-protocol-16 Recurrent neural network equation, Ct=tanh(Wc·[ht-1,Pt]+bc), formula representation.](/files/ftp_upload/69743/69743eq14.jpg)

![figure-protocol-18 Ot gate activation formula, σ(Wo·[ht-1,Pt]+bo), crucial in recurrent neural network computations.](/files/ftp_upload/69743/69743eq16.jpg)

Output:

Figure 3: Architecture of CNN-LSTM model. Structural representation of the Convolutional Neural Network-Long Short-Term Memory hybrid model, demonstrating convolutional feature extraction followed by unidirectional temporal sequence processing. Please click here to view a larger version of this figure.
CNN-BiLSTM (Figure 4): The CNN-BiLSTM hybrid model first extracts spatial features using a 1D convolutional layer with 32 filters, followed by batch normalization and max pooling to reduce dimensionality. The output is then passed through a stack of two Bidirectional LSTM layers to capture long-term temporal dependencies in both forward and backward directions. Regularization is applied via dropout and batch normalization. A dense layer with 128 neurons refines the learned representation before the final output layer maps it to a single predicted value.
CNN operation:
Max pooling: 
Bidirectional LSTM:
,
Output:

Figure 4: Architecture of CNN-BiLSTM model. Architecture diagram of the Convolutional Neural Network-Bidirectional Long Short-Term Memory model, highlighting the combination of convolutional layers with bidirectional recurrent processing for enhanced temporal dependency capture. Please click here to view a larger version of this figure.
CNN-GRU (Figure 5): The CNN-GRU hybrid model starts with a Conv1D layer using a kernel size of 1 to extract spatial features from the single timestep. Max pooling reduces spatial dimensions. This is followed by a stack of GRU layers the first returns sequences to capture temporal dependencies, and the second summarizes the sequence to a compact representation. A final dense layer outputs the predicted value. Dropout regularization is applied between GRU layers to prevent overfitting.
CNN operation:
Max pooling:
GRU cell: ![figure-protocol-31 Recurrent neural network equation, z_t = σ(W_z · [h_(t-1), P_t]), depicting gate activation.](/files/ftp_upload/69743/69743eq23.jpg)

![figure-protocol-33 Recurrent neural network equation `ĥₜ = tanh(Wₕ·[rₜ⊙hₜ₋₁,Pₜ])`; neural compute process.](/files/ftp_upload/69743/69743eq25.jpg)

Output: 

Figure 5: Architecture of CNN-GRU model. Schematic of the Convolutional Neural Network-Gated Recurrent Unit hybrid model, showing convolutional preprocessing integrated with GRU layers for efficient temporal modeling. Please click here to view a larger version of this figure.
CNN-transformer (Figure 6) The CNN-transformer model starts with a Conv1D layer to extract local features from the input sequence, followed by a max pooling layer. These features are passed through a Transformer encoder block consisting of a multi-head self-attention mechanism, layer normalization, and a feed-forward dense network. Global average pooling is then applied before a final dense layer outputs the prediction. This architecture is designed to capture both spatial patterns (via CNN) and global dependencies (via Transformer attention).
CNN operation: 
Multi-Head Self-Attention:

Where: Q, K, V = XWQ, XWK, XWV and dk is the dimension of keys.
Feed Forward Network:

Add & Norm Layers:


Output: 

Figure 6: Architecture of CNN-Transformer model. Structural overview of the Convolutional Neural Network-Transformer hybrid model, incorporating convolutional feature extraction with multi-head attention mechanisms for advanced temporal pattern recognition. Please click here to view a larger version of this figure.
Ensemble model development
To enhance forecasting accuracy and model robustness, we implemented a weighted average ensemble approach using predictions from the five hybrid deep learning models: RF-BiLSTM, CNN-LSTM, CNN-BiLSTM, CNN-GRU, and CNN-Transformer. The ensemble was constructed by assigning optimized weights to each model's predictions, with higher weights given to models demonstrating superior individual performance, as measured by their R² scores. This weighting strategy ensures that more accurate models contribute more significantly to the final forecast while still leveraging the complementary strengths of all architectures. The ensemble output was then evaluated using standard performance metrics: R², mean absolute error (MAE), and mean squared error (MSE) to assess its predictive accuracy, consistency, and generalization capability. This deep learning ensemble aims to integrate temporal feature extraction from multiple perspectives, thereby achieving greater accuracy and robustness than any single hybrid model in isolation.
Mathematical Formulation of the ensemble technique:
Let 
represent the set of base models corresponding to CNN-RF-BiLSTM, CNN-LSTM, CNN-BiLSTM, CNN-GRU, and CNN-Transformer.
Each base model Mi produces a prediction: 
The meta-feature matrix for stacking is formed as: 
The Ridge Regression meta-learner estimates the final prediction as: 
where:
-- wi are the learned stacking weights
-- w₀ is the bias term
To avoid overfitting, Ridge Regression minimizes the following regularized loss function:

where:
-- yj = true target for the jth sample
-- N = total number of samples
-- α = regularization parameter controlling weight shrinkage
The ensemble prediction is obtained as: 
where the weights wi are automatically learned by minimizing the Ridge loss function.