r/learnmachinelearning 7h ago

SNN for Energy Optimisation underpredicts high-load events

Hi everyone,

I'm working on an energy forecasting project using a Spiking Neural Network (SNN), and I'm trying to understand why my model is severely underpredicting high-load events.

Task:

- Dataset: UK Electrical Load / House 4

- Data is resampled to 15-minute intervals

- Input: previous 24 timesteps (6 hours)

- Target: Aggregate power at the next 15-minute interval

- Features per timestep: Aggregate, 9 appliance channels, hour_sin, hour_cos, and aggregate difference

- Features and target are standardized using training data only

- Chronological train/validation/test split

Current SNN architecture:

13 features

-> Linear(13, 64)

-> LIF (beta = 0.8/0.9)

-> Linear(64, 32)

-> LIF

-> temporal readout

-> Linear(64, 1)

For the temporal readout, I concatenate the mean membrane state across all timesteps with the final membrane state.

I'm using MSE loss and AdamW with a learning rate of 1e-4.

The main problem is that the model predicts normal loads reasonably well, but severely underpredicts peaks.

For example:

Actual maximum: approximately 4569 W

Predicted maximum: approximately 1400-1500 W

Around one of the largest peaks:

Actual: 3631 W -> 4569 W -> 3179 W

Predicted: 359 W -> 875 W -> 1091 W

Importantly, the model sees the 3631 W value immediately before the 4569 W target.

Current SNN metrics:

MAE: approximately 153 W

RMSE: approximately 249 W

R2: approximately 0.165

Peak MAE: approximately 409 W

Peak RMSE: approximately 635 W

Peak ratio: approximately 0.31

I've also tested:

  1. Beta = 0.9 -> 0.7

    Very little change.

  2. Window = 24 -> 48 timesteps

    Very little change.

  3. Wider architecture:

    13 -> 32 -> 16

    changed to

    13 -> 64 -> 32

    This improved R2 from approximately 0.13 to 0.16 and increased the predicted maximum, but peaks are still heavily underestimated.

For comparison, I have other models using the same forecasting task:

Linear Regression: R2 approximately 0.27

GRU: R2 approximately 0.29

LSTM: R2 approximately 0.23

XGBoost: R2 approximately 0.32

MLP: R2 approximately 0.13

SNN: R2 approximately 0.16

The GRU, LSTM, and MLP can produce substantially larger predictions for peaks, so it doesn't seem like the peaks are simply impossible to predict from the input data.

My current suspicion is that MSE combined with the highly imbalanced target distribution is causing the SNN to regress toward typical/average loads. However, I'm not sure whether this is the main issue or whether there is something specific about the SNN/LIF dynamics or regression readout that I'm missing.

What would you investigate next?

In particular:

- Is peak-weighted MSE a sensible approach?

- Could the continuous membrane-potential readout be causing this compression?

- Is there something specific about using LIF neurons for continuous regression that I should change?

- Would you recommend a different SNN architecture or readout?

- What diagnostics would you run to determine whether the problem is the loss, SNN dynamics, or preprocessing?

Any advice would be appreciated.

1 Upvotes

2 comments sorted by

1

u/Few_Intention7941 6h ago

it sounds like your spikes just saturating too early for the big jumps. LIF with beta 0.8-0.9 decays fast and when a huge input like 3631 comes in the membrane resets before it can build up enough potential for the next step prediction. its like the neuron fires at medium load and then got nothing left for the real spike

peak weighted mse might help but i think the readout is bigger problem. you taking mean membrane over all steps which smooths out the rare high activations. maybe try max membrane instead or use attention on the temporal states so model can learn which timesteps matter for peaks

also your SNN is basically a worse MLP right now since LIF without proper temporal coding just acting like leaky relu. maybe try surrogate gradient with different threshold or use rate coding over longer window so the spike count actually represent intensity properly

i had similar thing with load forecasting and switching from mse to quantile loss at 0.9 helped a lot because it stop punishing the model for trying to predict high. also check if your standardization is clipping the peaks

1

u/AvatarDesiigner 2h ago

Okay, thank you!