This project explores Spiking Neural Networks (SNNs) for environmental sound classification using the ESC-10 dataset.
Multiple spike encoding strategies and SNN architectures are implemented and benchmarked with PyTorch + snnTorch.
-
preprocessing.py🎧
Audio loading and preprocessing: log-Mel spectrograms, normalization, padding and data augmentation. -
spike_encoding.py⚡
Dataset classes implementing different spike encodings:- Delta Modulation
- Threshold Adaptive Encoding (TAE)
- Step Forward Encoding
-
models.py🧠
Spiking neural architectures:- Fully-connected SNN (
SNNClassifier) - Convolutional SNN (
C_SNN)
- Fully-connected SNN (
-
train_eval.py📊
Training loop and evaluation utilities (accuracy, F1-score, confusion matrices). -
env-soundnet.ipynb🚀
End-to-end notebook to run preprocessing, training and evaluation
(main entry point).
Install the required dependencies
The project uses the ESC-10 dataset, organized by class as follows.
Each folder contains the corresponding .wav audio files.
- Open
env-soundnet.ipynb(recommended: Google Colab ☁️) - Configure the dataset path
- Run the notebook cells sequentially to:
- load and preprocess audio data 🎧
- apply spike encoding strategies ⚡
- train SNN and Conv-SNN models 🧠
- evaluate performance and analyze results 📊
Trained models are automatically saved to disk 💾.
- The modular design allows easy experimentation with different spike encodings and network architectures.
- Spike trains and neural activity can be visualized using the provided analysis utilities 📈.