SpikeRain: Towards Energy-Efficient Single Image Deraining with Spiking Neural Networks [Paper]
Md Tanvir Islam 1, Inzamamul Alam 2, Sambit Bakshi 3, Khan Muhammad 2, *, Javier Del Ser 4, Sangtae Ahn 1, *
| 1. Kyungpook National University, South Korea | 2. Sungkyunkwan University, South Korea | 3. National Institute of Technology, India | 4. University of the Basque Country, Spain || *Corresponding Authors |
assets/
figures/ # Figures used in the paper/README
paper/ # Accepted paper PDF
model/
modules.py # Core blocks: DSRB, MDSA, Temporal Fusion, ARFE
spikerain.py # SpikeRain model definition and factory
utils/ # Utility helpers (metrics, model utils, etc.)
dataset_loader.py # Training dataset loader
train.py # Training script
test.py # Inference/testing script
evaluation.py # PSNR/SSIM/LPIPS evaluation
requirements.txt # Python dependencies
conda create -n spikerain python=3.8 -y
conda activate spikerain
pip install -r requirements.txtThe repository expects paired rainy/clean images stored in per-dataset folders. A recommended layout is:
data/
Rain200H/
train/
input/
gt/
test/
input/
gt/
Naming conventions:
- Input images are the rainy observations in
input/. - Ground-truth images are the clean targets in
gt/. - Supported image formats include
.pngand.jpg.
Important: dataset_loader.py expects the clean folder to be named target/ for training and validation. You can either:
- Rename
gt/→target/, or - Create a symlink
targetpointing togt.
RW-Data: This dataset has no ground truth. The provided evaluation.py requires paired targets, so for RW-Data use qualitative inspection or external no-reference metrics.
The training script already exposes arguments via argparse. Example:
python train.py \
--train_dir ./data/Rain200H/train \
--val_dir ./data/Rain200H/test \
--model_save_dir ./checkpoints \
--version M \
--T 4Common arguments:
--train_dir: path to training set root (containsinput/andtarget/).--val_dir: path to validation/test set root (containsinput/andtarget/).--model_save_dir: output checkpoint directory.--version: model size variant (S,M,L).--T: number of spiking timesteps.
python test.py \
--weights ./checkpoints/SpikeRain_M/models/<session>/model_best.pth \
--data_path ./data/Rain200H/test/input \
--save_path ./results/Rain200HKey arguments:
--data_path: directory containing input rainy images.--save_path: output directory for restored images.--model_version: model size variant (S,M,L).--T: number of spiking timesteps.
python evaluation.py \
--generated_images_path ./results/Rain200H \
--target_path ./data/Rain200H/test/gtevaluation.py computes PSNR, SSIM, and LPIPS. For datasets without ground truth (e.g., RW-Data), skip this script or use no-reference metrics.
The training script sets random seeds for Python, NumPy, and PyTorch. It also enables torch.backends.cudnn.benchmark = True, which favors performance over strict determinism.
If you find our work useful in your research, please consider citing our paper and star ✨✨ this repository. Thank you!
@InProceedings{Islam_2026_WACV,
author = {Islam, Md Tanvir and Alam, Inzamamul and Bakshi, Sambit and Muhammad, Khan and Del Ser, Javier and Ahn, Sangtae},
title = {SpikeRain: Towards Energy-Efficient Single Image Deraining with Spiking Neural Networks},
booktitle = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
month = {March},
year = {2026},
pages = {1094-1105}
}We would like to thank the authors of ESDNet for introducing SNN-based deraining.
