Next Article in Journal
Enhancing Flood Resilience by Retrofitting Old Communities for Sustainable Urban Renewal: A Robust Causal Diagnostic Framework
Previous Article in Journal
Multi-Time-Scale Energy Storage Stochastic Planning for Power Systems During Typhoon
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Hybrid CNN–GRU-Based Demand–Supply Forecasting to Enhance Sustainability in Renewable-Integrated Smart Grids

by
Süleyman Emre Eyimaya
1 and
Necmi Altin
2,3,*
1
Department of Electronics and Automation, TUSAS-Kazan Vocational School, Gazi University, 06560 Ankara, Türkiye
2
Department of Electrical-Electronics Engineering, Faculty of Technology, Gazi University, 06560 Ankara, Türkiye
3
Electrical Engineering Department, Molinaroli College of Engineering and Computing, University of South Carolina (USC), Columbia, SC 29208, USA
*
Author to whom correspondence should be addressed.
Sustainability 2026, 18(5), 2417; https://doi.org/10.3390/su18052417
Submission received: 24 January 2026 / Revised: 19 February 2026 / Accepted: 26 February 2026 / Published: 2 March 2026

Abstract

The rapid integration of renewable energy sources in smart grids has introduced significant uncertainty in both power generation and consumption patterns, posing challenges to environmental, economic, and operational sustainability. Accurate short-term forecasting of energy demand and supply is essential for achieving optimal scheduling, grid stability, and resilient operation in renewable-integrated power systems. This study proposes a hybrid deep learning framework combining Convolutional Neural Networks (CNN) and Gated Recurrent Units (GRU) for intelligent joint demand–supply forecasting in smart grids. The model was developed and implemented in MATLAB using real-world datasets comprising electricity consumption, photovoltaic (PV) generation, temperature, and irradiance variables. Comparative evaluations demonstrate that the hybrid CNN–GRU outperforms single-model approaches, including Long Short-Term Memory (LSTM), GRU, and eXtreme Gradient Boosting (XGBoost), based on Root Mean Square Error (RMSE) and Mean Absolute Percentage Error (MAPE) metrics. On a 14-day test set, the proposed model achieves RMSE values of approximately 34 kW for demand and 28 kW for PV generation, with MAPE of approximately 4% and 6%, respectively. Furthermore, average net-load RMSE is reduced by approximately 15–25% relative to GRU/LSTM baselines, while maintaining controlled errors of approximately 35–40 kW during sharp ≥100 kW/15 min ramp events. By reducing net-load uncertainty and improving forecasting precision, the proposed framework enhances renewable energy utilization, supports more efficient reserve allocation and storage scheduling, and provides a quantitative tool for sustainability-oriented energy management. Consequently, the study contributes to the advancement of sustainable smart grid operation and the broader transition toward low-carbon and resilient energy systems.

1. Introduction

The rapid expansion of renewable energy sources (RES) is reshaping power systems by increasing decentralization, variability, and uncertainty, which necessitates advanced monitoring, forecasting, and control in smart grids [1]. Global assessments document large-scale growth in solar and wind alongside operational challenges from intermittency and forecasting errors that impact reliability and economics [2]. Smart grids integrate power electronics, pervasive sensing, and bidirectional communications to coordinate distributed energy resources and enable demand-side participation, improving flexibility and efficiency under high-RES conditions [3]. In this context, ensuring sustainability in modern power systems requires not only increasing renewable penetration but also enhancing forecasting accuracy, operational efficiency, and system resilience to manage variability in a reliable and economically viable manner.
Accurate short-term forecasting of both demand and renewable supply underpins core smart grid functions, including economic dispatch, reserve scheduling, demand response, storage operation, and net-load tracking [4]. In operational terms, net load is the key variable because it directly indicates the residual power that must be supplied by the upstream grid, storage, or dispatchable units. Therefore, joint demand–PV forecasting reduces uncertainty in economic dispatch and demand response by producing a coherent day-ahead balance trajectory instead of combining two separate forecasts. Intra-day and day-ahead predictions reduce balancing costs and improve reliability margins by informing unit commitment and procurement strategies in markets with increasing RES shares [5]. Wind and solar forecasts are essential to mitigate ramps and peak events, determine reserve requirements, and support secure grid operation at scale [6]. Consequently, unified demand–supply prediction has become a foundational capability for data-driven energy management and distribution-level decision support [7].
Joint demand–supply prediction is challenging due to heterogeneous nonlinear dynamics, strong dependence on meteorological and calendar drivers, and multi-scale temporal structure (intra-hour to seasonal) [8]. From a decision-making perspective, separate errors in demand and PV can compound in the resulting balance signal, so unified modeling is important for reducing operational uncertainty. Traditional statistical approaches often degrade under regime shifts and cross-variable interactions, limiting operational usefulness when uncertainty dominates [9]. These challenges motivate unified, data-driven models that learn dependencies among consumption, weather, and distributed generation to produce coherent energy balance forecasts for storage scheduling, demand response, and market participation in renewable-rich systems [10]. Previous studies often forecast load and PV separately or rely on single-model architectures that may require substantial feature engineering and can be less robust under rapidly changing weather and ramp events. To address this gap, a compact hybrid CNN–GRU framework for joint day-ahead forecasting of demand and PV (and net load) is proposed. The proposed method is evaluated using a strict chronological protocol and analyzed under both clear sky and variable weather conditions.
Deep learning advances multivariate time-series forecasting by learning hierarchical representations directly from data, improving robustness over manual feature engineering [11]. Convolutional neural networks (CNNs) capture local temporal motifs and ramps, while gated recurrent units (GRUs) model sequential dependencies with lower parameterization and faster convergence than long short-term memory (LSTM) methods [12]. Hybrid architectures that combine convolutional feature extraction with recurrent temporal modeling have demonstrated strong performance in energy forecasting tasks [13]. Recent surveys highlight hybrid and attention-based models as state-of-the-art for load and renewable generation forecasting under high variability and exogenous drivers [14]. These insights motivate a CNN–GRU backbone for joint demand–supply prediction.
LSTM and GRU networks are widely adopted baselines for short-term load and PV forecasting, particularly with exogenous weather and calendar features [15]. Deep recurrent models have shown strong accuracy for building and grid-level load prediction but can be sensitive to sequence length selection and long-range dependencies [16]. Gradient boosting methods such as XGBoost provide competitive tabular baselines and interpretability; however, they typically require extensive feature engineering to represent temporal structure [17]. Comparative reviews in power systems indicate that, while these single-model approaches are effective, hybrid deep architectures often achieve superior accuracy under volatile, weather-driven conditions [18].
CNN-based approaches enhance robustness by extracting temporal patterns related to ramps and daily cycles. In short-term load forecasting, 1D-CNN pipelines have achieved notable accuracy improvements across residential and building datasets [19]. For PV forecasting, CNNs that incorporate irradiance and temperature as exogenous inputs deliver improved performance under variable weather regimes [20]. CNN encoders frequently serve as front ends in hybrid models, enhancing feature quality before recurrent or attention modules in multivariate settings characteristic of smart grids [21]. Empirical evidence supports CNNs as effective components for capturing localized temporal patterns in energy series [22].
GRU-based models often match or surpass LSTM performance with fewer parameters and faster training, enabling near–real-time deployment in grid applications [23]. In short-term load and PV forecasting, GRUs effectively learn temporal dependencies and generalize well when combined with weather and calendar features [24]. Studies report improved stability and reduced vanishing-gradient issues relative to deeper LSTM stacks in limited-data or nonstationary settings [25]. GRUs have been successfully applied to net-load prediction and building energy forecasting, demonstrating favorable bias–variance trade-offs in operational scenarios [26]. These characteristics make GRU layers strong temporal backbones within hybrid forecasting pipelines [27].
Hybrid CNN–GRU models explicitly leverage convolutional feature extraction and recurrent temporal memory to represent multiscale, exogenously driven energy time series. Prior work shows improved accuracy for short-term load and PV forecasting by jointly capturing rapid ramps and diurnal patterns, especially when meteorological variables are integrated [28]. Hybrid pipelines with convolutional front ends and gated recurrent back ends demonstrate superior performance to single-model baselines in benchmarks reflecting renewable-rich volatility [29]. Reviews and case studies in power systems further recommend hybrid designs for multivariate, jointly modeled tasks typical of smart grids, citing consistent gains in accuracy and robustness [30,31].
Recent PV-forecasting studies emphasize that feature design substantially affects accuracy and that explicitly modeling weather-driven uncertainty (e.g., via weather prediction errors) can further reduce PV forecast errors across diverse PV system configurations (on-grid, hybrid, and off-grid). These findings support the inclusion of meteorological covariates in our forecasting pipeline and motivate future extensions that augment the proposed CNN–GRU inputs with uncertainty-aware weather-error features when numerical weather predictions are available [32]. Recent hybrid deep-learning architectures that couple temporal-convolutional feature extractors with GRU-based sequence modeling (e.g., TCN–ECANet–GRU) demonstrate that leveraging multivariate meteorological inputs can improve short-term PV power forecasting accuracy across seasonal conditions [33]. From a probabilistic perspective, CNN–GRU variants have also been used to produce quantile forecasts and show that adding exogenous NWP/multivariate weather information can yield further gains, especially when solar variability is high [34]. Systematic reviews of deep learning for PV forecasting consistently highlight meteorological variable selection and input design (often including irradiance- and temperature-related covariates) as primary determinants of model performance and comparability across sites and horizons [35].
This study develops and evaluates a MATLAB-implemented hybrid CNN–GRU framework for intelligent joint prediction of demand and supply in smart grids. Leveraging multivariate historical consumption, PV generation, and meteorological variables, the model produces short-term forecasts of demand, supply, and net energy balance. The performance of the proposed method is evaluated against benchmark models, including LSTM, GRU, CNN, XGBoost, and a persistence baseline, using RMSE, MAE, MAPE, R2, and balance error as performance metrics. The objective is to enable more reliable load balancing and storage scheduling through accurate, unified forecasts that reflect coupled dynamics of consumption and renewable generation, thereby supporting data-driven energy management and operational decision-making.
The main contributions of this study are:
(1)
Proposing a hybrid CNN–GRU deep learning framework for joint day-ahead forecasting of electricity demand (load) and PV generation (supply) in renewable-integrated smart-grid settings;
(2)
Developing a reproducible MATLAB-based pipeline covering data synchronization, preprocessing, sliding-window sequence generation, and model training/testing under strictly chronological splits to avoid leakage;
(3)
Performing a comprehensive evaluation against widely used baselines (persistence, XGBoost, CNN, GRU, and LSTM) using standard accuracy metrics (RMSE, MAE, MAPE, and R2) together with an operationally relevant net-load accuracy perspective;
(4)
Demonstrating robustness on representative test days including clear sky and variable/cloudy conditions, highlighting the practical relevance of the proposed approach for scheduling and energy management applications. By improving joint demand–supply forecasting accuracy and reducing net-load uncertainty, the proposed framework contributes to operational and environmental sustainability by enabling more efficient renewable energy utilization, improved reserve allocation, and enhanced stability in renewable-rich power systems.
The objective of this study is to develop a hybrid CNN–GRU model to jointly forecast electricity demand (load) and PV generation (supply) (and the implied net load) for a 24 h-ahead horizon (96 steps at 15 min resolution) using historical demand/PV and exogenous weather/calendar features. The article also aims to answer the following questions: whether the hybrid CNN–GRU approach improves the accuracy of joint demand-PV generation forecasting compared to basic methods such as CNN, GRU, LSTM, XGBoost, and persistence; to what extent model performance is maintained under clear and variable/cloudy conditions; and whether the improved joint forecast reduces the net load error level during operationally critical peak and ramp periods. Addressing these questions provides a scientifically grounded basis for sustainability-oriented smart grid management, where reducing forecasting uncertainty directly supports resilient, efficient, and low-carbon energy system operation.
The paper is organized as follows: Section 2 formulates the problem and describes the dataset and preprocessing workflow. Section 3 presents the proposed hybrid CNN–GRU methodology and the designed smart grid system. Section 4 reports the simulation setup and the forecasting results, including comparisons with baseline models and additional error analyses. Finally, Section 5 concludes the paper and outlines limitations and directions for future work (e.g., probabilistic forecasting, transformer-based extensions, and tighter integration with MATLAB/Simulink energy-management frameworks). Overall, the proposed forecasting framework strengthens the technical foundation of sustainable smart grid operation by quantitatively reducing uncertainty in renewable-integrated energy systems and supporting more reliable, efficiency-oriented grid management.

2. Hybrid CNN–GRU Method

Short-term, multi-output forecasting of electricity demand, photovoltaic (PV) supply, and net load constitutes a core enabler for smart grid operations, supporting scheduling, reserve allocation, and demand response. The predictive setting considers synchronized, multivariate time-series windows that integrate historical load and PV generation with meteorological covariates and calendar indicators. Net load is operationally defined as the difference between demand and PV generation, as given in Equation (1), and is particularly informative under volatile weather and ramp conditions. A hybrid convolutional neural network–gated recurrent unit (CNN–GRU) architecture is adopted to extract local temporal motifs and to model longer-range dependencies with low latency, yielding direct multi-step forecasts over operational horizons. Evaluation follows strictly chronological splits with rolling-origin assessment and reports RMSE, MAE, MAPE (where targets are strictly positive), R2, and a net-load balance error. Net load is defined as the difference between demand and PV generation, which is given in Equation (1).
N L t = L t P V t
Here, NL(t) is the net load at time t, L(t) is the electricity demand (load) at time t, and PV(t) is the PV generation at time t.
The forecasting function maps the input window to multi-step, multi-target outputs, as given in Equation (2).
Ŷ t = f θ X t R H × T
Here, Ŷ(t) is the H-step-ahead prediction matrix at time t, (·) is the forecasting model parameterized by θ, Xt is the W × F input window (W recent time steps by F features), H is the forecast horizon length, and T is the number of targets (e.g., load, PV, net load).
Models are evaluated using RMSE and MAE (overall accuracy), MAPE (only when targets are strictly positive), R2 (goodness of fit), and net-load balance error (RMSE on NL); ramp-specific error is additionally reported for intervals with large |Δy|. All experiments follow strictly chronological splits and rolling-origin evaluation to avoid leakage and assess stability across regimes.

2.1. Data Sources and Preprocessing

Four synchronized modalities at a common cadence (e.g., 15 min) are used: aggregated load, PV output, meteorology (irradiance proxies, temperature, humidity, wind; optionally cloud cover), and calendar indicators. Streams are time-aligned; short gaps are forward-filled and longer gaps imputed via seasonal statistics or weather-guided interpolation; outliers are treated with robust dispersion within hour/season strata and replaced by local medians; scaling (Standard or Min–Max) is fit on training and applied unchanged to validation/test; sliding-window inputs and direct multi-step (or iterated one-step) outputs are formed with light feature engineering (few lags and rolling means). If the data are re-sampled to alternative time resolutions, the same preprocessing pipeline can be applied after aggregation/interpolation, followed by re-windowing and re-training at the new cadence.

2.2. Hybrid CNN–GRU Architecture and Training

The 1D convolution used in the encoder is given in Equation (3).
z c τ = σ k = 0 K 1 f = 0 F w c , k , f · X f τ k + b c
Here, zc(τ) is the activation at temporal position τ in channel c, σ(·) is a nonlinearity (e.g., ReLU), K is the kernel length, F is the number of input features, w{c,k,f} is the convolution weight for channel c at lag k and feature f, Xf(τ−k) is the value of feature f at time (τk) within the window, and bc is the bias for channel c.
The GRU state update is given in Equations (4)–(7).
z t = σ W z x t + U z h t 1 + b z
r t = σ W r x t + U r h t 1 + b r
h ~ t = tanh W h x t + U h r t h t 1 + b h
h t = 1 z t h t 1 + z t h ~ t
Here, zt is the update gate at time t, rt is the reset gate at time t, xt is the input vector at time t (e.g., the convolved features at t), h{t−1} is the previous hidden state, h ~ t is the candidate hidden state, σ(·) is the logistic sigmoid, tanh(·) is the hyperbolic tangent, W and U are weight matrices, b are biases, and ⊙ denotes element-wise multiplication.
The empirical risk minimized during training is given in Equation (8).
L θ = 1 N i = 1 N h = 1 H w h · l ŷ i t i + h , y i t i + h
Here, L(θ) is the average training loss over N samples, wh is the optional weight for horizon step h, (·,·) is a point-loss (e.g., mean squared error or Huber), ŷ i t i + h is the prediction for sample i at horizon h, y i t i + h is the corresponding ground truth, and θ denotes all learnable parameters.
In addition, the proposed framework is trained for direct multi-step forecasting over the full day-ahead horizon, rather than using an iterative one-step recursion. This design helps reduce error accumulation, since predictions at later horizons are not fed back as inputs. The CNN–GRU combination further improves robustness by jointly modeling local variations and longer dependencies, which stabilizes multi-horizon outputs under uncertainty. The forecasting outputs generated by this hybrid CNN–GRU framework are subsequently integrated into the smart grid energy management architecture described in the following section, where the model’s predictive capability supports system-level operational decisions.

3. Proposed Smart Grid System

This section presents the proposed smart grid system in which the hybrid CNN–GRU forecasting model is deployed. The aim is to design a compact yet realistic MATLAB-based framework for short-term joint forecasting of electricity demand and PV supply, and to show how these forecasts can be directly utilized by operational control and planning functions.
The system considers a campus-scale or small distribution-level feeder with significant PV penetration and pronounced daily load variability. Historical consumption and PV generation are integrated with meteorological variables, primarily temperature and irradiance, at a 15 min cadence to produce multi-step, 24 h-ahead forecasts. The PV subsystem is configured at 500 kWp DC using 600 Wp modules (approximately 833 PV modules), arranged into four strings feeding 400 kW of total inverter capacity (DC/AC ≈ 1.25). Under clear sky conditions, this configuration yields midday AC outputs in the range of 350–400 kW, covering a substantial fraction of the underlying demand.
The load profile corresponds to an aggregated campus or mixed-use facility with a characteristic night baseline around 250 kW and two daily peaks, typically in the morning and evening. The evening peak is dominant, frequently reaching 850–950 kW, which creates opportunities for both peak shaving and PV-driven self-consumption improvement. Day-to-day variability and weekday/weekend effects introduce additional uncertainty that must be captured by the forecasting model.
Within this context, the hybrid CNN–GRU model is used to extract both local temporal patterns (e.g., rapid ramps, diurnal cycles) and long-range dependencies (e.g., weather regimes, occupancy patterns). The model ingests sliding windows of multivariate time series and outputs coordinated forecasts of demand, PV supply, and optionally net load. These forecasts are then consumed by higher-level functions such as storage scheduling, reserve allocation, and demand response planning. The proposed architecture is intentionally modular, allowing each block, data acquisition, forecasting, control, and visualization to be developed, tested, and upgraded independently within MATLAB. The proposed system architecture for short-term joint forecasting of demand and photovoltaic (PV) supply using a hybrid CNN-GRU model is presented in Figure 1.
The design philosophy emphasizes reproducibility and clarity: all components can be implemented with standard MATLAB toolboxes, using clearly defined interfaces between data, models, and control algorithms. This makes the system suitable both as a research testbed and as a teaching example for intelligent demand–supply prediction in smart grids.

3.1. Designed System Parameters

The system adopts a minimal yet representative configuration that reflects realistic campus-scale operations. PV supply is modeled from irradiance and temperature using a performance ratio assumption, while demand is modeled as an aggregated time series with diurnal and weekly structure. The objective is not to perfectly emulate a specific real-world site, but to capture the dominant interactions among load, PV generation, and weather in a way that meaningfully tests the forecasting model. Importantly, this statement refers to the representative testbed description (system sizing and scenario narrative), not to the data source: the forecasting model is trained and evaluated using real 15 min measurements (aggregated load, aggregated PV generation, ambient temperature, and global horizontal irradiance) collected in Columbia (US) during Summer 2025. We intentionally report the site in aggregated, anonymized form for confidentiality, and therefore we avoid claiming that the described PV sizing and campus configuration corresponds to a uniquely identifiable facility.
The simulation and evaluation are based on a campus-scale dataset collected in Columbia, United States, during the summer of 2025, with a 15 min sampling interval. The measurements include aggregated electricity demand (kW), PV generation (kW), ambient temperature (°C), and global horizontal irradiance (W/m2), all synchronized under a common timestamp. During this period, demand typically ranges from approximately 250 kW at night to 850–950 kW at the evening peak, while PV output reaches approximately 350–400 kW (AC) around midday on clear sky days. As an indicative summer range for Columbia, ambient temperature is approximately 20–35 °C, and irradiance varies from 0 W/m2 (nighttime) up to roughly 900–1000 W/m2 around midday on clear sky days, with substantially lower and more rapidly fluctuating values under cloudy conditions. For privacy and operational confidentiality, the data are reported in aggregated form and contain no customer-level information. The proposed system parameters therefore serve as a reproducible campus-scale testbed; multi-site validation is left for future work and would require site-specific metering, PV characteristics, and local weather inputs.
Time resolution, input window length, forecast horizon, and train/test splits are chosen to reflect typical operational requirements. The 15 min resolution follows the native granularity of the available smart-meter/PV monitoring streams and captures real intra-hour ramps and irradiance-driven PV fluctuations. The 168 h (7-day) input window is selected to learn real weekly structure (weekday/weekend behavior) and multi-day weather persistence/regime changes, which directly affect both demand and PV generation. A 15 min sampling interval is used to balance temporal granularity with computational cost. Although this study uses 15 min data, the proposed pipeline is not restricted to a specific metering resolution. When moving to finer resolutions, short-term ramps and intra-hour variability can be represented more explicitly, at the cost of longer sequences and higher computational load; when moving to coarser resolutions (e.g., hourly), fast dynamics may be smoothed and the input window and hyperparameters should be re-tuned accordingly. This trade-off is consistent with prior smart-meter analyses on PV self-consumption showing that the choice of recording interval (from 1 to 60 min) affects the error when matching PV generation and household consumption profiles, and that recommended resolutions may differ for daily versus annual assessments (e.g., finer for daily analyses and coarser for annual reporting) [36]. The input window covers 168 h (672 steps) of history, enabling the model to view multiple diurnal cycles and distinguish regular patterns from anomalies. The forecast horizon is 24 h (96 steps), which is appropriate for day-ahead planning and storage scheduling. The full 96-step day-ahead trajectory is generated in a direct multi-step manner, rather than by iteratively rolling a one-step model forward. This avoids the recursive feedback loop in which early-step errors propagate and amplify across the horizon.
On the supply side, the PV plant has 500 kWp DC installed capacity. Using 600 Wp modules, this corresponds to approximately 833 modules. These are organized into four strings feeding four 100 kW inverters for a total AC capacity of 400 kW, giving a DC/AC ratio of 1.25, which is common in modern PV design to maximize inverter utilization. A performance ratio (PR) of around 0.80 is assumed, implicitly accounting for system losses (temperature effects, wiring, inverters, etc.).
On the demand side, the aggregated load exhibits a night baseline of roughly 250 kW and a distinct evening peak of 850–950 kW, with morning ramp-up also visible. Intra-day variability in the order of ±10% is present, and pronounced weekday/weekend differences are assumed. These characteristics create a non-trivial forecasting problem where both short-term ramps and longer-term patterns must be captured. Table 1 summarizes the main system parameters used in the designed scenario.

3.2. Designed Hybrid CNN–GRU Model

The forecasting pipeline converts raw multivariate time series into supervised sequences using sliding windows. At each prediction time, the model receives an input tensor representing the last Tin = 168 h (672 steps) of measurements and calendar features and produces Tout = 24 h (96 steps) of forecasts for demand and PV. Net load can be obtained either as a direct output or by subtracting the predicted PV from the predicted demand.
The input variables include aggregated demand (kW), aggregated PV output (kW), ambient temperature (°C), global irradiance (W/m2), and simple calendar encodings such as hour-of-day and day-of-week using sine/cosine transformations. All numerical inputs are standardized using Z-score scaling fitted on the training set and applied unchanged to validation and test sets. This improves optimization stability and prevents features with larger numeric range from dominating the gradients. Kernel size 3 was used to capture short-term ramps at 15 min resolution; 64 filters provide sufficient feature diversity with limited complexity; and a 128 → 64 GRU stack balances model capacity and overfitting risk, as confirmed on the validation set.
The CNN component of the model is responsible for summarizing local temporal patterns and cross-variable interactions. Two 1D convolutional blocks with, for example, 64 filters and kernel size 3 are used, each followed by nonlinearity (ReLU) and max pooling. Convolutions act as learnable temporal filters that can detect patterns such as morning ramps, midday PV plateaus, and evening peaks across multiple variables simultaneously. Max pooling reduces the effective sequence length and provides some robustness to small timing shifts and noise.
The GRU component stacks one or two recurrent layers (e.g., 128 units followed by 64 units) with dropout for regularization. The GRU layers operate on the feature sequences produced by the CNN, aggregating information over longer horizons and maintaining a compressed hidden representation of the past. This design enables the model to combine fine-grained local structure (captured by the CNN) with extended memory and temporal smoothing (provided by the GRU).
On top of the GRU layers, a dense output head maps the final temporal representation to multi-step forecasts. This head is implemented as one or two fully connected layers with linear activation at the output, producing a vector of length Tout × Ntargets, where Ntargets is 2 (demand and PV) or 3 (if net load is also predicted explicitly). The unified dense output layer enables simultaneous prediction of multiple targets through a shared latent representation. This design enforces a joint loss function that captures intrinsic correlations among outputs, thereby mitigating the error compounding effect common in isolated or sequential forecasting models. By learning interdependencies directly, the model ensures consistent and physically coherent energy balance forecasts. Unlike iterative multi-step approaches, where prediction errors propagate across horizons, the proposed architecture constrains outputs through a shared optimization objective, reducing error accumulation. This coherence across demand and generation forecasts enhances the reliability of net load prediction and contributes directly to operational stability in smart grid applications. The model is trained using mean squared error (MSE) loss over all horizons and targets, minimized with the Adam optimizer. A learning rate on the order of 10−3 with a decay scheduler is used, and early stopping is applied based on validation performance.
Table 2 summarizes the main input–output configuration and core hyperparameters of the designed hybrid CNN–GRU model.

4. Simulation Results

This section presents the simulation results obtained with the proposed hybrid CNN–GRU forecasting framework implemented in MATLAB. The model is evaluated on a campus-scale smart grid dataset at 15 min resolution, using a 168 h input window and a 24 h forecast horizon. Performance is reported for demand and PV generation, as well as for net load, and the hybrid CNN–GRU is compared against several baseline models, including persistence, XGBoost, pure CNN, pure GRU, and LSTM. Each subsection includes at least one representative figure together with a quantitative discussion of the corresponding results.

4.1. Experimental Setup and Evaluation Protocol

The proposed hybrid CNN–GRU forecasting framework was implemented and evaluated in MATLAB using a campus-scale smart grid dataset. The dataset comprises synchronized measurements of aggregated demand (kW), PV generation (kW), ambient temperature (°C), and global irradiance (W/m2) sampled at a 15 min resolution. Training is performed offline, while inference is executed every 15 min; the average inference time per 96-step forecast is reported as ~0.10 s on a CPU, demonstrating suitability for near-real-time operation. Calendar indicators, including hour of day and day of week, were encoded using sine and cosine transformations and appended as additional input features. A sliding input window of Tin = 168 h (672 steps) is used to construct multivariate sequences, and the forecasting horizon is set to Tout = 24 h (96 steps). For each prediction time, the model receives the last seven days of data and produces direct multi-step forecasts for the next day. The time series is split chronologically into a 90-day training period and a 14-day test period; a subset of the training period is reserved as a validation set to tune hyperparameters and perform early stopping. This strictly chronological split avoids information leakage and mimics realistic deployment conditions where models are trained on past data and applied to future, unseen days. The split is strictly chronological to avoid leakage and to emulate training on past data and testing on future unseen days. The 14-day test period includes both clear sky and variable/cloudy conditions to assess robustness under different irradiance regimes. Although the test window is 14 days, results are computed by aggregating errors across all days and across all 96 forecast steps (rolling-origin evaluation), which reduces sensitivity to any single day and provides a consistent assessment of day-ahead performance under mixed weather regimes.
Prior to training, missing samples were identified and handled using simple yet robust strategies: short gaps were forward-filled, and longer gaps were imputed based on seasonal statistics within similar hours and days. Outliers were detected using robust dispersion measures and replaced by local medians to reduce the impact of measurement errors. All numerical input variables (demand, PV, temperature, irradiance) were standardized using Z-score normalization fitted on the training set and applied unchanged to validation and test sets. This scaling improves optimization stability and ensures that no single variable dominates the gradient updates due to its numeric range.
The hybrid CNN–GRU model was trained using the Adam optimizer with a learning rate on the order of 10−3, a mini-batch size appropriate for GPU memory, and early stopping based on validation loss to prevent overfitting. For comparison, several baseline models were implemented in MATLAB: (i) a persistence benchmark that uses the previous day’s profile as the forecast, (ii) an XGBoost regressor applied to handcrafted lag and calendar features, (iii) a pure CNN model, (iv) a pure GRU model, and (v) an LSTM model. All models were trained on the same input–output pairs and evaluated on the identical 14-day test set. Performance was assessed using multiple complementary metrics. For each target (demand and PV generation) and for net load (defined as demand minus PV generation), we report root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE, where applicable), and coefficient of determination (R2). In addition, a net-load RMSE metric is computed to quantify accuracy in predicting the energy balance that is directly relevant for storage scheduling and peak management. Evaluation is performed in a rolling-origin fashion over the test period, and metrics are aggregated across all forecast horizons and test days.
Figure 2 summarizes the sequence of steps from raw data acquisition and preprocessing, through sequence construction and model training, to test-set evaluation and metric computation.

4.2. Day-Ahead Forecasting on Clear Sky Days

To illustrate the behavior of the proposed model under typical operating conditions, this subsection presents a representative day-ahead forecasting example for both demand and PV generation. The example corresponds to a clear sky weekday in the test period, where the underlying patterns are relatively regular and the PV output exhibits a smooth bell-shaped profile around midday. In this case study, the hybrid CNN–GRU model is given the previous 168 h of multivariate data (demand, PV, temperature, irradiance, and calendar features) and is tasked with predicting the next 24 h at a 15 min resolution.
Figure 3 shows the resulting day-ahead forecasts. The upper panel depicts the actual and forecasted demand profiles over the day. The observed load shows a night-time baseline around 250 kW, a moderate morning rise, and a dominant evening peak approaching 900 kW. The CNN–GRU forecast closely follows these dynamics, capturing both the timing and magnitude of the morning ramp and the evening peak. For this clear sky day, the daily RMSE for demand remains below 40 kW, corresponding to a daily MAPE of about 3% relative to the peak load, and the coefficient of determination R2 exceeds 0.95.
The lower panel of Figure 3 presents the corresponding PV generation time series. Under clear sky conditions, the actual PV output exhibits a smooth ramp-up starting in the morning, a broad midday plateau around 350–400 kW, and a ramp-down toward zero in the late afternoon. The hybrid CNN–GRU model reproduces this profile with high fidelity, accurately tracking the ramp-up slope, the duration and level of the midday plateau, and the evening decrease. The daily RMSE for PV is below 25 kW, with a MAPE around 5% relative to the midday peak of approximately 380 kW. Small residual errors around the shoulders of the PV curve are expected due to minor irradiance fluctuations, but they remain within acceptable operational limits.
Overall, the clear sky example in Figure 3 demonstrates that the proposed hybrid CNN–GRU can provide highly accurate and well-aligned point forecasts for both demand and PV power under nominal conditions. This level of accuracy is particularly valuable for day-ahead unit commitment, reserve planning, and storage scheduling in smart grids.
The upper panel shows the actual and predicted demand profiles, including the night-time baseline, morning ramp, and evening peak. The lower panel presents the corresponding PV generation profiles, where the model accurately tracks the smooth ramp-up, midday plateau, and ramp-down under clear sky conditions.

4.3. Performance Under Variable Weather Conditions

Realistic smart grid operation also involves highly variable weather conditions that induce rapid PV fluctuations and more irregular demand behavior. To assess the robustness of the proposed model under such conditions, this subsection focuses on a cloudy test day characterized by frequent cloud passages and sharp changes in irradiance. On this day, the PV output departs significantly from the smooth bell-shaped curve, exhibiting multiple local peaks and dips.
Figure 4 illustrates the forecasting performance of the hybrid CNN–GRU and selected baselines on this variable weather day. For PV, the CNN–GRU is able to follow the main structure of the trajectory, substantially reducing large systematic biases relative to the persistence and XGBoost models. Typical PV RMSE values on such days lie in the range of 30–35 kW for the CNN–GRU, with MAPE around 8–10%, whereas the persistence model often exhibits RMSE above 40 kW and noticeably higher MAPE due to its inability to anticipate rapid changes.
Demand is indirectly affected by weather through temperature- and occupancy-driven behavior, but the daily pattern remains more regular than PV. On the cloudy day shown in Figure 4, the hybrid CNN–GRU maintains demand RMSE in the range of 35–40 kW and MAPE around 4%, still outperforming recurrent and tree-based baselines by approximately 10–20% in RMSE terms. These results indicate that the convolutional front end helps the model capture short-lived patterns associated with rapid irradiance changes, while the GRU layers preserve longer-term context, leading to robust performance under challenging meteorological regimes.
The model tracks the main structure of the demand and PV trajectories more closely than baseline methods, particularly during fast irradiance transitions.

4.4. Comparative Accuracy of Different Models

To provide a global quantitative comparison across models, this subsection summarizes the average test-set performance for demand and PV generation in terms of RMSE and MAPE. The considered forecasting methods are persistence, XGBoost, CNN, GRU, LSTM, and the proposed CNN–GRU. All metrics are computed over the full 14-day test horizon and across all 96 forecast steps in the 24 h horizon.
Figure 5 presents a grouped bar chart of RMSE and MAPE for each model. For demand, the hybrid CNN–GRU achieves the lowest RMSE, with values on the order of 30–40 kW and MAPE around 3–4%, representing an approximate 10–20% improvement over GRU and LSTM baselines and an even larger gain over persistence. For PV, the CNN–GRU similarly outperforms all other methods, with RMSE typically in the range of 20–30 kW and MAPE around 5–6%, compared to higher errors for tree-based and purely recurrent models.
The performance gains are particularly evident when focusing on net-load RMSE, which directly reflects the accuracy of the energy balance prediction relevant for operational planning. Across the 14-day test horizon, the CNN–GRU consistently yields the lowest net-load RMSE, whereas persistence and XGBoost exhibit larger deviations due to their limited ability to jointly model correlated demand and PV dynamics. These comparative results confirm that combining convolutional feature extraction with gated recurrent units yields both statistically and operationally significant improvements in short-term demand–supply forecasting for smart grids.
To further demonstrate the competitiveness of the proposed framework, Table 3 presents a comparative summary of our results against recent studies in literature, focusing on architecture, time resolution, and MAPE performance.
As shown in Table 3, the proposed hybrid CNN-GRU model achieves a MAPE range of 4.0–6.0%, demonstrating strong competitiveness relative to recent state-of-the-art architectures. In particular, the proposed model performs favorably compared to TCN-ECANet-GRU and Q-CNN-GRU while operating at a finer 15 min resolution. Since shorter temporal resolution typically introduces higher volatility and forecasting complexity, the results indicate that the integration of convolutional feature extraction and gated recurrent units effectively captures short-term demand-supply dynamics. These findings support the robustness and practical applicability of the proposed forecasting framework for smart grid operations.
The proposed hybrid CNN–GRU model consistently outperforms persistence, XGBoost, CNN, GRU, and LSTM baselines, and achieves the lowest net-load RMSE. In order to contextualize the achieved accuracy beyond our internal baselines, we note that the error levels reported in related deep and hybrid forecasting studies (Refs. [19,20,21,22,23,24,25,26,27]) vary considerably with dataset scale, time resolution, forecast horizon, and the availability of meteorological inputs. While direct one-to-one numerical comparison is therefore limited, our results (Demand MAPE ≈ 3–4% and PV MAPE ≈ 5–6% over a 96-step, 15 min day-ahead horizon) fall within the range reported for recent hybrid architectures in comparable short-term settings, supporting the competitiveness of the proposed CNN–GRU framework.

4.5. Net-Load Forecasting and Operational Indicators

Net-load forecasting, defined as predicting the difference between demand and PV generation, is of central importance for grid operators because it directly determines the residual power that must be supplied by conventional generators, storage systems, or the upstream grid. This subsection focuses on a representative high-demand day in the test set, with particular emphasis on the evening peak period when the PV contribution has largely vanished and the load reaches its maximum.
Figure 6 presents the net-load time series (actual versus forecast) for this peak day. The hybrid CNN–GRU model successfully captures both the timing and the magnitude of the net-load peak, with an absolute peak error typically below 40 kW and a timing deviation within one 15 min interval. Over the entire day, the net-load RMSE remains in the range of 35–45 kW, and the daily MAPE is around 4–5% with respect to the maximum net load.
When aggregated over the full 14-day test period, the CNN–GRU achieves the lowest net-load RMSE among all compared models, while also reducing the maximum absolute error observed across days. For instance, average net-load RMSE is reduced by approximately 15–25% relative to GRU and LSTM baselines, and even more when compared to persistence, which often misestimates peaks on days with significant changes in demand or PV behavior. From an operational standpoint, improved net-load forecasting translates into more accurate sizing of spinning reserves, better utilization of battery energy storage systems, and more reliable triggering of demand response programs, thereby enhancing both economic efficiency and reliability in smart grid operation. In practice, this can reduce conservative reserve procurement and avoid unnecessary storage charge/discharge actions triggered by anticipated imbalance errors.
While the present evaluation is campus-scale, the proposed data-driven framework is model-agnostic to geography and can be deployed in other regions by re-training/fine-tuning on site-specific load/renewable profiles and local meteorology. For larger grids, the approach can be applied at feeder/zone level with aggregated measurements and extended feature sets (e.g., spatially distributed weather, additional renewable outputs, and flexible loads such as EV charging). Training is performed offline, whereas inference is executed every 15 min; the average inference time per 96-step day-ahead forecast is approximately ~0.10 s on CPU, indicating suitability for near-real-time operation.
The model accurately captures the timing and magnitude of the evening net-load peak, which is critical for reserve sizing and storage scheduling.

4.6. Error Distribution and Ramp-Specific Analysis

Beyond average accuracy metrics, it is important to understand the distribution and structure of forecasting errors, particularly under challenging conditions such as large ramps. To this end, this subsection analyzes both the overall error distribution and the relationship between error magnitude and ramp size for the proposed model and selected baselines.
Figure 7 summarizes the distribution of forecast errors for the hybrid CNN–GRU model and two recurrent baselines (GRU and LSTM) over the entire 14-day test set. For demand, the CNN–GRU exhibits the lowest median absolute error and the narrowest interquartile range, indicating that typical prediction errors are both smaller and more tightly concentrated. For example, the median absolute error for demand remains around 20 kW with an interquartile range of approximately 10–30 kW, whereas the LSTM and GRU baselines show higher medians (around 25–30 kW) and wider spreads. A similar pattern is observed for PV generation, where the proposed model reduces the frequency and magnitude of large outliers, particularly on days with rapidly changing irradiance.
In addition, the relationship between forecast error and ramp magnitude can be examined to evaluate model robustness during sudden changes. Scatter plots of absolute error versus ramp size indicate that, for demand ramps larger than 100 kW per 15 min interval, the average absolute error of the CNN–GRU remains in the range of 35–40 kW, while the GRU and LSTM baselines typically exhibit errors between 45–55 kW, and the persistence benchmark often exceeds 60 kW. A similar trend is observed for PV power during rapid irradiance transitions. This behavior is operationally important, since large ramps correspond to the most challenging events for grid operators, such as evening load increases and fast cloud passages. The ability of the hybrid CNN–GRU model to limit errors under these conditions directly supports more reliable reserve sizing, ramp-rate control, and battery scheduling.
The boxplots summarize the absolute errors for demand and PV across all horizons, illustrating lower median error and reduced spread for the proposed model, particularly under ramping conditions.

5. Conclusions

This study presented a hybrid CNN–GRU deep learning framework for intelligent short-term demand–supply forecasting in smart grids. By combining convolutional feature extraction with gated recurrent temporal modeling, the proposed architecture effectively captures both local temporal motifs and long-range dependencies in multivariate energy time series. The model was developed and validated in MATLAB using real-world datasets comprising electricity load, PV generation, and meteorological variables.
On the 14-day test set, the proposed CNN–GRU achieved the lowest forecasting errors among all compared methods, with approximately Demand RMSE ≈ 34 kW and PV RMSE ≈ 28 kW, while maintaining low percentage errors (Demand MAPE ≈ 4% and PV MAPE ≈ 6%).Under challenging variable weather days, typical PV RMSE remains around 30–35 kW, while demand RMSE stays around 35–40 kW, indicating stable performance over the 96-step (24 h) horizon. In addition, net-load forecasting accuracy improved by reducing peak-period deviations and ramp-related errors compared to persistence and single-model baselines. Operationally, the strongest gain is the ~15–25% reduction in net-load error, which directly supports tighter reserve sizing, fewer peak-period deviations, and more BESS-friendly scheduling (reduced corrective cycling). Moreover, during sharp ramp intervals (≥100 kW per 15 min), the CNN–GRU limits absolute errors to ≈35–40 kW, indicating robust behavior under the most critical operating events.
The proposed CNN–GRU model outperforms conventional single-model approaches, including LSTM, GRU, CNN, XGBoost, and persistence baselines, in terms of RMSE, MAE, MAPE, and R2. In RMSE terms, the proposed model provides an improvement on the order of ~10–20% for demand compared to recurrent and tree-based baselines, while average net-load RMSE is reduced by approximately 15–25% relative to GRU and LSTM baselines over the same 96-step horizon, making the performance gain quantitatively explicit (not only qualitative). Practically, these improvements enable more reliable day-ahead scheduling, better reserve sizing, and improved battery energy storage operation through more accurate net-load estimates, supporting peak shaving and load balancing in renewable-rich smart grids, which are essential pillars for achieving long-term environmental sustainability goals. The results highlight the potential of hybrid deep learning architectures as core components of data-driven, adaptive smart grid operation frameworks. By providing high-precision forecasting, this study supports sustainability-oriented energy management by reducing operational uncertainty, improving renewable integration efficiency, and enhancing resource utilization in renewable-rich smart grids.
Nevertheless, the present evaluation is limited to a campus-scale scenario and a relatively short time span (90 days training, 14 days testing), which restricts conclusions about seasonal and cross-site generalization; furthermore, the current study reports point forecasts without uncertainty bounds and does not include multi-year cross-validation or formal statistical significance testing. Because the dataset covers a limited period, seasonal generalization cannot be fully assessed; future work will evaluate the method on multi-season and multi-year datasets to quantify seasonality robustness. This study does not include multi-year cross-validation or formal statistical significance tests across folds; incorporating multi-year data and significance testing (e.g., paired tests over days/horizons) is part of future work. The current work focuses on point forecasting; probabilistic forecasting and uncertainty quantification will be considered in future work to provide prediction intervals for operational risk-aware decisions.
Future work will explore probabilistic forecasting extensions, transformer-based architectures for long-range dependency modeling, and tighter integration of the forecasting module with reinforcement learning-based energy management systems in MATLAB/Simulink. At a 15 min resolution, the forecasting module naturally aligns with typical supervisory EMS/RL decision cycles in MATLAB/Simulink, where actions (e.g., BESS charge/discharge set points or demand-response signals) are updated every 15 min rather than at fast inner-loop power electronics rates. Since training is performed offline and online inference is lightweight (≈0.10 s per 96-step forecast on CPU), the computational burden is small relative to the 900 s control interval, leaving sufficient time for RL policy evaluation and optimization. Scalability to higher-penetration or larger systems can be addressed by feeder/zone-level aggregation, parallel evaluation across zones, and periodic re-training, while keeping the real-time loop feasible for practical deployment. Future studies will also extend validation to multi-season/multi-year and multi-site datasets and will quantify computational cost (training time and inference latency) to support real-time deployment claims. These directions aim to further improve robustness, interpretability, and real-time adaptability under high renewable penetration and nonstationary operating conditions. Ultimately, the proposed hybrid deep learning model strengthens the technical foundation of sustainable smart grid operation by quantitatively improving forecasting reliability and operational efficiency in renewable-integrated energy systems.

Author Contributions

Conceptualization, S.E.E. and N.A.; methodology, N.A.; software, S.E.E. and N.A.; validation, S.E.E. and N.A.; formal analysis, N.A.; investigation, S.E.E.; resources, N.A.; data curation, S.E.E.; writing—original draft preparation, S.E.E.; writing—review and editing, N.A.; visualization, S.E.E.; supervision, N.A.; project administration, N.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. REN21. Renewables 2024 Global Status Report; REN21: Paris, France, 2024. [Google Scholar]
  2. International Energy Agency (IEA). World Energy Outlook 2023; IEA: Paris, France, 2023. [Google Scholar]
  3. Fang, X.; Misra, S.; Xue, G.; Yang, D. Smart grid—The new and improved power grid: A survey. IEEE Commun. Surv. Tutor. 2011, 14, 944–980. [Google Scholar] [CrossRef]
  4. Hong, T.; Fan, S. Probabilistic electric load forecasting: A tutorial review. Int. J. Forecast. 2016, 32, 914–938. [Google Scholar] [CrossRef]
  5. Nowotarski, J.; Weron, R. Recent advances in electricity price forecasting: A review of probabilistic forecasting. Renew. Sustain. Energy Rev. 2018, 81, 1548–1568. [Google Scholar] [CrossRef]
  6. Pinson, P. Wind energy: Forecasting challenges for its operational management. Statist. Sci. 2013, 28, 564–585. [Google Scholar] [CrossRef]
  7. Singla, P.; Duhan, M.; Saroha, S. A comprehensive review and analysis of solar forecasting techniques. Front. Energy 2022, 16, 187–223. [Google Scholar] [CrossRef]
  8. Hyndman, R.J.; Athanasopoulos, G. Forecasting: Principles and Practice; Otexts: Melbourne, Australia, 2018. [Google Scholar]
  9. Weron, R. Electricity price forecasting: A review of the state-of-the-art. Int. J. Forecast. 2014, 30, 1030–1081. [Google Scholar] [CrossRef]
  10. Nti, I.K.; Teimeh, M.; Nyarko-Boateng, O.; Adekoya, A.F. Electricity load forecasting: A systematic review. J. Electr. Syst. Inf. Technol. 2020, 7, 13. [Google Scholar] [CrossRef]
  11. Melnyk, S.; Vasiutynska, K.; Korduba, I.; Trach, Y.; Trach, R.; Butenko, D.; Wrzesiński, G. Modeling and forecasting of the local climate of Odesa using CNN-LSTM and the statistical analysis of time series. Sustainability 2025, 17, 8424. [Google Scholar] [CrossRef]
  12. Chung, J.; Gulcehre, C.; Cho, K.; Bengio, Y. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv 2014, arXiv:1412.3555. [Google Scholar]
  13. Feng, Y.; Zhu, J.; Qiu, P.; Zhang, X.; Shuai, C. Short-term power load forecasting based on TCN-BiLSTM-attention and multi-feature fusion. Arab. J. Sci. Eng. 2025, 50, 5475–5486. [Google Scholar] [CrossRef]
  14. Lai, G.; Chang, W.-C.; Yang, Y.; Liu, H. Modeling long- and short-term temporal patterns with deep neural networks. In Proceedings of the 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, Ann Arbor, MI, USA, 8–12 July 2018; pp. 95–104. [Google Scholar]
  15. Eyimaya, S.E.; Altin, N.; Nasiri, A. Optimization of photovoltaic and battery storage sizing in a DC microgrid using LSTM networks based on load forecasting. Energies 2025, 18, 3676. [Google Scholar] [CrossRef]
  16. Lago, J.; Marcjasz, G.; De Schutter, B.; Weron, R. Forecasting day-ahead electricity prices: A review of state-of-the-art algorithms, best practices and an open-access benchmark. Appl. Energy 2021, 293, 116983. [Google Scholar] [CrossRef]
  17. Nalluri, M.; Pentela, M.; Eluri, N.R. A scalable tree boosting system: XG boost. Int. J. Res. Stud. Sci. Eng. Technol. 2020, 7, 36–51. [Google Scholar]
  18. Raza, M.Q.; Khosravi, A. A review on artificial intelligence based load demand forecasting techniques for smart grid and buildings. Renew. Sustain. Energy Rev. 2015, 50, 1352–1372. [Google Scholar] [CrossRef]
  19. Eskandari, H.; Imani, M.; Moghaddam, M.P. Convolutional and recurrent neural network based model for short-term load forecasting. Electr. Power Syst. Res. 2021, 195, 107173. [Google Scholar] [CrossRef]
  20. Abdel-Nasser, M.; Mahmoud, K. Accurate photovoltaic power forecasting models using deep LSTM-RNN. Neural Comput. Appl. 2019, 31, 2727–2740. [Google Scholar] [CrossRef]
  21. Hinton, G.; Deng, L.; Yu, D.; Dahl, G.E.; Mohamed, A.-R.; Jaitly, N.; Kingsbury, B. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Process. Mag. 2012, 29, 82–97. [Google Scholar] [CrossRef]
  22. Kiartzis, S.J.; Bakirtzis, A.G.; Petridis, V. Short-term load forecasting using neural networks. Electr. Power Syst. Res. 1995, 33, 1–6. [Google Scholar] [CrossRef]
  23. Cho, K.; Van Merriënboer, B.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv 2014, arXiv:1406.1078. [Google Scholar]
  24. Marino, D.L.; Amarasinghe, K.; Manic, M. Building energy load forecasting using deep neural networks. In Proceedings of the IECON 2016-42nd Annual Conference of the IEEE Industrial Electronics Society, Florence, Italy, 23–26 October 2016; pp. 7046–7051. [Google Scholar]
  25. Ryu, S.; Noh, J.; Kim, H. Deep neural network based demand side short term load forecasting. Energies 2016, 10, 3. [Google Scholar] [CrossRef]
  26. Gao, C.; Zhang, S.; Li, Z.; Zhou, B.; Guo, D.; Shao, W.; Li, H. Photovoltaic power prediction based on similar day clustering combined with CNN-GRU. Sustainability 2025, 17, 7383. [Google Scholar] [CrossRef]
  27. Wang, H.; Lei, Z.; Zhang, X.; Zhou, B.; Peng, J. A review of deep learning for renewable energy forecasting. Energy Convers. Manag. 2019, 198, 111799. [Google Scholar] [CrossRef]
  28. Bhatti, A.A.; Irshad, F.I.; Al-Suhaibi, A.; Shahid, K.; Khan, A.A. A load classification strategy using NILM and DNN for potential demand-side management. Innov. Comput. Rev. 2025, 5, 56–68. [Google Scholar]
  29. Li, P.; Zhou, K.; Lu, X.; Yang, S. A hybrid deep learning model for short-term PV power forecasting. Appl. Energy 2020, 259, 114216. [Google Scholar] [CrossRef]
  30. Amasyali, K.; El-Gohary, N.M. A review of data-driven building energy consumption studies. Renew. Sustain. Energy Rev. 2018, 81, 1192–1205. [Google Scholar] [CrossRef]
  31. Wang, Y.; Chen, Q.; Hong, T.; Kang, C. Review of smart meter data analytics: Applications, methodologies, and challenges. IEEE Trans. Smart Grid 2018, 10, 3125–3148. [Google Scholar] [CrossRef]
  32. Bâra, A.; Oprea, S.V. Embedding the weather prediction errors (WPE) into the photovoltaic (PV) forecasting method using deep learning. J. Forecast. 2024, 43, 1173–1198. [Google Scholar] [CrossRef]
  33. Xiang, X.; Li, X.; Zhang, Y.; Hu, J. A short-term forecasting method for photovoltaic power generation based on the TCN-ECANet-GRU hybrid model. Sci. Rep. 2024, 14, 6744. [Google Scholar] [CrossRef]
  34. Ait Mouloud, L.; Kheldoun, A.; Oussidhoum, S.; Alharbi, H.; Alotaibi, S.; Alzahrani, T.; Agajie, T.F. Seasonal quantile forecasting of solar photovoltaic power using Q-CNN-GRU. Sci. Rep. 2025, 15, 27270. [Google Scholar] [CrossRef]
  35. Husein, M.; Gago, E.J.; Hasan, B.; Pegalajar, M.C. Towards energy efficiency: A comprehensive review of deep learning-based photovoltaic power forecasting strategies. Heliyon 2024, 10, e33419. [Google Scholar] [CrossRef]
  36. Jiménez-Castillo, G.; Rus-Casas, C.; Tina, G.M.; Muñoz-Rodriguez, F.J. Effects of smart meter time resolution when analyzing photovoltaic self-consumption system on a daily and annual basis. Renew. Energy 2021, 164, 889–896. [Google Scholar] [CrossRef]
Figure 1. Proposed system architecture for joint short-term forecasting of demand and PV supply using a hybrid CNN–GRU model.
Figure 1. Proposed system architecture for joint short-term forecasting of demand and PV supply using a hybrid CNN–GRU model.
Sustainability 18 02417 g001
Figure 2. Overall MATLAB-based simulation and evaluation pipeline for the proposed hybrid CNN–GRU model.
Figure 2. Overall MATLAB-based simulation and evaluation pipeline for the proposed hybrid CNN–GRU model.
Sustainability 18 02417 g002
Figure 3. Example day-ahead forecasting performance of the hybrid CNN–GRU model for a clear sky weekday in the test set.
Figure 3. Example day-ahead forecasting performance of the hybrid CNN–GRU model for a clear sky weekday in the test set.
Sustainability 18 02417 g003
Figure 4. Forecasting performance of the hybrid CNN–GRU model and baseline methods on a cloudy test day with rapidly varying PV generation.
Figure 4. Forecasting performance of the hybrid CNN–GRU model and baseline methods on a cloudy test day with rapidly varying PV generation.
Sustainability 18 02417 g004
Figure 5. Comparison of forecasting accuracy for different models on the 14-day test set in terms of RMSE and MAPE for demand and PV.
Figure 5. Comparison of forecasting accuracy for different models on the 14-day test set in terms of RMSE and MAPE for demand and PV.
Sustainability 18 02417 g005
Figure 6. Net-load forecasting results of the hybrid CNN–GRU model for a representative high-demand test day.
Figure 6. Net-load forecasting results of the hybrid CNN–GRU model for a representative high-demand test day.
Sustainability 18 02417 g006
Figure 7. Distribution of forecast errors for the hybrid CNN–GRU model compared to GRU and LSTM baselines on the 14-day test set.
Figure 7. Distribution of forecast errors for the hybrid CNN–GRU model compared to GRU and LSTM baselines on the 14-day test set.
Sustainability 18 02417 g007
Table 1. System parameters of the proposed smart grid.
Table 1. System parameters of the proposed smart grid.
CategoryParameterValue/Description
Time & ScopeTime resolution15 min
Time & ScopeInput window (Tin)168 h = 672 steps
Time & ScopeForecast horizon (Tout)24 h = 96 steps
Time & ScopeExample periods90 days training; 14 days test
PV (Supply)Total DC capacity500 kWp
PV (Supply)Module rating/count600 Wp/833 modules
PV (Supply)Strings/Inverters (AC)4 strings; 4 × 100 kW = 400 kW AC
PV (Supply)DC/AC ratio/PR1.25; performance ratio ≈ 0.80
PV (Supply)Midday peak (clear sky)350–400 kW (AC)
Demand (Load)Night baseline≈250 kW
Demand (Load)Daily peaksMorning rise; evening peak 850–950 kW
Demand (Load)Variability±10%; distinct weekday/weekend pattern
BESS (optional)Energy capacity500 kWh
BESS (optional)Power rating250 kW charge/250 kW discharge
BESS (optional)Round-trip efficiency0.90
BESS (optional)SOC limits10–90%
Table 2. Model I/O and core hyperparameters.
Table 2. Model I/O and core hyperparameters.
CategoryItemConfiguration/Notes
InputsVariablesDemand (kW), PV (kW), temperature (°C), irradiance (W/m2), calendar (sin/cos)
InputsScalingZ-score (fit on training set)
InputsWindowingTin = 168 h → Tout = 24 h (15 min cadence)
ArchitectureCNNTwo Conv1D blocks (e.g., 64 filters, kernel size = 3) + Max-Pool1D
ArchitectureGRUOne–two GRU layers (e.g., 128 → 64 units) with dropout
ArchitectureOutput headDense multi-step outputs (demand, PV, optional net load)
TrainingLoss/OptimizerMSE; Adam (e.g., learning rate = 10−3 with scheduler)
EvaluationMetricsRMSE, MAPE (per-horizon and aggregated), optionally R2 and net-load RMSE
DeploymentInferenceMATLAB batch (daily) and online (every 15 min)
Table 3. Comparative analysis with existing literature.
Table 3. Comparative analysis with existing literature.
StudyArchitectureResolutionMAPE (%)
Ref. [20]Deep LSTM-RNN60 min5.00–9.00%
Ref. [32]Deep Learning (WPE)60 min6.50–9.20%
Ref. [33]TCN-ECANet-GRU15 min4.82–6.15%
Ref. [34]Q-CNN-GRU60 min5.50–8.50%
ProposedHybrid CNN-GRU15 min4.00–6.00%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Eyimaya, S.E.; Altin, N. Hybrid CNN–GRU-Based Demand–Supply Forecasting to Enhance Sustainability in Renewable-Integrated Smart Grids. Sustainability 2026, 18, 2417. https://doi.org/10.3390/su18052417

AMA Style

Eyimaya SE, Altin N. Hybrid CNN–GRU-Based Demand–Supply Forecasting to Enhance Sustainability in Renewable-Integrated Smart Grids. Sustainability. 2026; 18(5):2417. https://doi.org/10.3390/su18052417

Chicago/Turabian Style

Eyimaya, Süleyman Emre, and Necmi Altin. 2026. "Hybrid CNN–GRU-Based Demand–Supply Forecasting to Enhance Sustainability in Renewable-Integrated Smart Grids" Sustainability 18, no. 5: 2417. https://doi.org/10.3390/su18052417

APA Style

Eyimaya, S. E., & Altin, N. (2026). Hybrid CNN–GRU-Based Demand–Supply Forecasting to Enhance Sustainability in Renewable-Integrated Smart Grids. Sustainability, 18(5), 2417. https://doi.org/10.3390/su18052417

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop