|
1 | | -<!-- PROJECT SHIELDS --> |
2 | | -<!-- |
3 | | -*** I'm using markdown "reference style" links for readability. |
4 | | -*** Reference links are enclosed in brackets [ ] instead of parentheses ( ). |
5 | | -*** See the bottom of this document for the declaration of the reference variables |
6 | | -*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use. |
7 | | -*** https://www.markdownguide.org/basic-syntax/#reference-style-links |
8 | | ---> |
9 | | -[![Stargazers][stars-shield]][stars-url] |
10 | | -[![Forks][forks-shield]][forks-url] |
11 | | -[![Contributors][contributors-shield]][contributors-url] |
12 | | -[![Issues][issues-shield]][issues-url] |
13 | | -[![MIT License][license-shield]][license-url] |
14 | | - |
15 | | -<!-- PROJECT LOGO --> |
16 | | -<br /> |
17 | | -<div align="center"> |
18 | | - <h3 align="center">Spiking-FullSubNet</h3> |
19 | | - |
20 | | - <p align="center"> |
21 | | - Intel N-DNS Challenge Algorithmic Track Winner |
22 | | - <br /> |
23 | | - <a href="https://haoxiangsnr.github.io/spiking-fullsubnet/"><strong>Explore the docs »</strong></a> |
24 | | - <br /> |
25 | | - <br /> |
26 | | - <a href="https://github.com/haoxiangsnr/spiking-fullsubnet/">View Demo</a> |
27 | | - · |
28 | | - <a href="https://github.com/haoxiangsnr/spiking-fullsubnet/issues">Report Bug</a> |
29 | | - · |
30 | | - <a href="https://github.com/haoxiangsnr/spiking-fullsubnet/issues">Request Feature</a> |
31 | | - </p> |
32 | | -</div> |
33 | | - |
34 | | - |
35 | | -<!-- ABOUT THE PROJECT --> |
36 | | -## About The Project |
37 | | - |
38 | | - |
39 | | - |
40 | | -We are proud to announce that Spiking-FullSubNet has emerged as the winner of Intel N-DNS Challenge Track 1 (Algorithmic). Please refer to our [brief write-up here](./Spiking-FullSubNet.pdf) for more details. This repository serves as the official home of the Spiking-FullSubNet implementation. Here, you will find: |
41 | | - |
42 | | -- A PyTorch-based implementation of the Spiking-FullSubNet model. |
| 1 | +# Spiking-FullSubNet |
| 2 | + |
| 3 | +Spiking-FullSubNet is the winner solution of Intel N-DNS Challenge Track 1 (Algorithmic). This repository serves as the official home of the Spiking-FullSubNet implementation. Here, you will find: |
| 4 | + |
| 5 | +- A PyTorch-based implementation of the Spiking-FullSubNet model described in our paper "Toward Ultralow-Power Neuromorphic Speech Enhancement With Spiking-FullSubNet". |
43 | 6 | - Scripts for training the model and evaluating its performance. |
44 | 7 | - The pre-trained models in the `model_zoo` directory, ready to be further fine-tuned on the other datasets. |
45 | | - |
46 | | -<!--- |
47 | | -We are actively working on improving the documentation, fixing bugs and removing redundancies. Please feel free to raise an issue or submit a pull request if you have suggestions for enhancements. |
48 | | -Our team is diligently working on a comprehensive paper that will delve into the intricate details of Spiking-FullSuNet's architecture, its operational excellence, and the broad spectrum of its potential applications. Please stay tuned! |
49 | | ---> |
| 8 | +- The frozen version of the solution used in the Intel N-DNS Challenge in the `38fe020` commit. |
50 | 9 |
|
51 | 10 | ## Updates |
52 | 11 |
|
53 | | -[2024-02-26] Currently, our repo contains two versions of the code: |
| 12 | +- 2026-01-27: The `main` branch shows the implementation of the Spiking-FullSubNet model as described in our published paper "Toward Ultralow-Power Neuromorphic Speech Enhancement With Spiking-FullSubNet", which includes several improvements and optimizations over the challenge version. We recommend using this branch for the citation and further research. |
| 13 | +- 2024-02-26: The **frozen version**, which serves as a backup for the submitted solution used in the Intel N-DNS Challenge. This solution has been checked and verified by Intel during the challenge. If you need to check the experimental results from that time, please refer to this specific commit: [38fe020](https://github.com/haoxiangsnr/spiking-fullsubnet/tree/38fe020cdb803d2fdc76a0df4b06311879c8e370). There you will find everything you need. After switching to this commit, you can place the checkpoints from the `model_zoo` into the `exp` directory and use `-M test` for inference or `-M train` to retrain the model. After challenge, we made some improvements and optimizations to the solution and published a paper (IEEE TNNLS) based on these improvements. Please check the `main` branch for the published paper version. |
| 14 | + |
| 15 | +## Quick Start |
| 16 | + |
| 17 | +You can either clone the repository, setup an environment and start with the scripts, or directly open in Colab (under construction). |
| 18 | + |
| 19 | +## Environment Setup |
| 20 | + |
| 21 | +We really like [uv](https://docs.astral.sh/uv/) and recommend using it as your package manager. But feel free to use whichever you prefer. |
54 | 22 |
|
55 | | -1. The **frozen version**, which serves as a backup for the code used in a previous competition. However, due to a restructuring in the `audiozen` directory, this version can no longer be directly used for inference. If you need to verify the experimental results from that time, please refer to this specific commit: [38fe020](https://github.com/haoxiangsnr/spiking-fullsubnet/tree/38fe020cdb803d2fdc76a0df4b06311879c8e370). There you will find everything you need. After switching to this commit, you can place the checkpoints from the `model_zoo` into the `exp` directory and use `-M test` for inference or `-M train` to retrain the model. |
| 23 | +> [!TIP] |
| 24 | +> uv is significantly faster (10~100x) than pip and handles dependency resolution more reliably. |
| 25 | +> The `uv.lock` file ensures reproducible installations across different machines. |
56 | 26 |
|
57 | | -2. The **latest version** of the code has undergone some restructuring and optimization to make it more understandable for readers. We've also introduced `acceleate` to assist with better training practices. We believe you can follow the instructions in the help documentation to run the training code directly. The pre-trained model checkpoints and a more detailed paper will be released by next weekend, so please stay tuned for that. |
58 | 27 |
|
| 28 | +```bash |
| 29 | +# Clone the repository |
| 30 | +git clone git@github.com:haoxiangsnr/spiking-fullsubnet.git && cd spiking-fullsubnet |
59 | 31 |
|
| 32 | +# [Optional] Install uv |
| 33 | +# Check https://docs.astral.sh/uv/ for other installation methods |
| 34 | +curl -LsSf https://astral.sh/uv/install.sh | sh |
60 | 35 |
|
61 | | -## Documentation |
| 36 | +# Install all dependencies (creates .venv automatically) |
| 37 | +# This will: |
| 38 | +# - Create a virtual environment in `.venv` |
| 39 | +# - Install all dependencies from `uv.lock` |
| 40 | +# - Install `audiozen` folder in editable mode so you can import it everywhere |
| 41 | +uv sync --all-extras |
62 | 42 |
|
63 | | -See the [Documentation](https://haoxiangsnr.github.io/spiking-fullsubnet/) for installation and usage. Our team is actively working to improve the documentation. Please feel free to raise an issue or submit a pull request if you have suggestions for enhancements. |
| 43 | +# Activate the virtual environment |
| 44 | +source .venv/bin/activate |
| 45 | +``` |
| 46 | + |
| 47 | +If you prefer Conda/pip, you can still use the traditional approach: |
| 48 | + |
| 49 | +```bash |
| 50 | +git clone git@github.com:haoxiangsnr/spiking-fullsubnet.git && cd spiking-fullsubnet |
| 51 | + |
| 52 | +conda create --name spiking-fullsubnet python=3.10 |
| 53 | +conda activate spiking-fullsubnet |
| 54 | + |
| 55 | +# torch==2.1.1 and torch==2.10 have been tested to work well with this codebase |
| 56 | +conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia |
| 57 | + |
| 58 | +# Install other dependencies and the `audiozen` folder in editable mode |
| 59 | +# Please check the `pyproject.toml` for the full list of dependencies |
| 60 | +pip install -e . |
| 61 | +``` |
| 62 | + |
| 63 | +## Inference on Validation Set |
| 64 | + |
| 65 | +Since the official test set requires a long time (10 hours+) for inference on a single GPU, |
| 66 | +we provide a mini-validation set to quickly verify. The validation set contains 341 noisy-clean pairs generated in the same way as the official test set. In our experience, performance gains on this set are highly positively correlated with the official test set. |
| 67 | + |
| 68 | +```bash |
| 69 | +# Download validation set from Github Releases |
| 70 | +cd <your_project_root> |
| 71 | +mkdir data && cd data |
| 72 | + |
| 73 | +# Download and extract validation set |
| 74 | +wget https://github.com/haoxiangsnr/spiking-fullsubnet/releases/download/data/validation_set.tar.gz |
| 75 | +tar -xzvf validation_set.tar.gz |
| 76 | + |
| 77 | +# folder structure: |
| 78 | +. |
| 79 | +└── data |
| 80 | + ├── validation_set |
| 81 | + │ ├── clean |
| 82 | + │ │ ├── clean_fileid_119.wav |
| 83 | + │ │ ├── clean_fileid_165.wav |
| 84 | + │ │ └── clean_fileid_7.wav |
| 85 | + │ ├── noise |
| 86 | + │ │ ├── noise_fileid_27.wav |
| 87 | + │ │ ├── noise_fileid_312.wav |
| 88 | + │ │ └── noise_fileid_4.wav |
| 89 | + │ └── noisy |
| 90 | + │ ├── book_00588_chp_0003_..._fileid_115.wav |
| 91 | + │ ├── book_09739_chp_0003_..._fileid_275.wav |
| 92 | + │ └── German_Wikiped_..._fileid_246.wav |
| 93 | + └── validation_set.tar.gz |
| 94 | +``` |
| 95 | + |
| 96 | +To run inference on the validation set using the pre-trained model, use the following command: |
| 97 | + |
| 98 | +```bash |
| 99 | +cd <your_project_root> |
| 100 | + |
| 101 | +# Download pre-trained model from Github Releases |
| 102 | +wget https://github.com/haoxiangsnr/spiking-fullsubnet/releases/download/ckpt-epoch-188/epoch_0188.zip |
| 103 | + |
| 104 | +# Unzip the pre-trained model to the correct directory |
| 105 | +mkdir -p recipes/intel_ndns/spiking_fullsubnet_v2/exp/middle-model__partition-0-32-128-256__grouping-8-32-64__deep-filtering-5-3-1__synops-1e-8/checkpoints/ |
| 106 | + |
| 107 | +unzip epoch_0188.zip -d recipes/intel_ndns/spiking_fullsubnet_v2/exp/middle-model__partition-0-32-128-256__grouping-8-32-64__deep-filtering-5-3-1__synops-1e-8/checkpoints/epoch_0188 |
| 108 | + |
| 109 | +# Inference on validation set |
| 110 | +accelerate launch --multi_gpu \ |
| 111 | + --num_processes=4 \ |
| 112 | + --gpu_ids 0,1,2,3 \ |
| 113 | + --main_process_port 46601 \ |
| 114 | + run.py \ |
| 115 | + --config_path conf/middle-model__partition-0-32-128-256__grouping-8-32-64__deep-filtering-5-3-1__synops-1e-8.yaml \ |
| 116 | + --eval_batch_size 4 \ |
| 117 | + --resume_from_checkpoint /home/xhao/proj/spiking-fullsubnet/recipes/intel_ndns/spiking_fullsubnet_v2/exp/middle-model__partition-0-32-128-256__grouping-8-32-64__deep-filtering-5-3-1__synops-1e-8/checkpoints/epoch_0188 \ |
| 118 | + --do_eval true |
| 119 | +``` |
| 120 | + |
| 121 | +Depending on your software environment, you may have the results like below: |
| 122 | + |
| 123 | +| set | si_sdr | P808 | OVRL | SIG | BAK | |
| 124 | +| ---------: | ------: | ------: | ------: | ------: | ------: | |
| 125 | +| validation | 15.0127 | 3.61135 | 3.01281 | 3.33227 | 3.93021 | |
| 126 | + |
| 127 | +## Citation |
| 128 | + |
| 129 | +If you find this repository useful for your research, please consider citing the following papers: |
| 130 | + |
| 131 | +```bibtex |
| 132 | +@ARTICLE{hao2025toward, |
| 133 | + author={Hao, Xiang and Ma, Chenxiang and Yang, Qu and Wu, Jibin and Tan, Kay Chen}, |
| 134 | + journal={IEEE Transactions on Neural Networks and Learning Systems}, |
| 135 | + title={Toward Ultralow-Power Neuromorphic Speech Enhancement With Spiking-FullSubNet}, |
| 136 | + year={2025}, |
| 137 | + volume={36}, |
| 138 | + number={9}, |
| 139 | + pages={17350-17364}, |
| 140 | + doi={10.1109/TNNLS.2025.3566021}} |
| 141 | +
|
| 142 | +@INPROCEEDINGS{hao2024when, |
| 143 | + author={Hao, Xiang and Ma, Chenxiang and Yang, Qu and Tan, Kay Chen and Wu, Jibin}, |
| 144 | + booktitle={2024 IEEE Conference on Artificial Intelligence (CAI)}, |
| 145 | + title={When Audio Denoising Meets Spiking Neural Network}, |
| 146 | + year={2024}, |
| 147 | + volume={}, |
| 148 | + number={}, |
| 149 | + pages={1524-1527}, |
| 150 | + doi={10.1109/CAI59869.2024.00275}} |
| 151 | +``` |
64 | 152 |
|
65 | 153 | ## License |
66 | 154 |
|
67 | | -All the code in this repository is released under the [MIT License](https://opensource.org/licenses/MIT), for more details see the [LICENSE](LICENSE) file. |
68 | | - |
69 | | - |
70 | | -<!-- MARKDOWN LINKS & IMAGES --> |
71 | | -<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> |
72 | | -[contributors-shield]: https://img.shields.io/github/contributors/haoxiangsnr/spiking-fullsubnet.svg?style=for-the-badge |
73 | | -[contributors-url]: https://github.com/haoxiangsnr/spiking-fullsubnet/graphs/contributors |
74 | | -[forks-shield]: https://img.shields.io/github/forks/haoxiangsnr/spiking-fullsubnet.svg?style=for-the-badge |
75 | | -[forks-url]: https://github.com/haoxiangsnr/spiking-fullsubnet/network/members |
76 | | -[stars-shield]: https://img.shields.io/github/stars/haoxiangsnr/spiking-fullsubnet.svg?style=for-the-badge |
77 | | -[stars-url]: https://github.com/haoxiangsnr/spiking-fullsubnet/stargazers |
78 | | -[issues-shield]: https://img.shields.io/github/issues/haoxiangsnr/spiking-fullsubnet.svg?style=for-the-badge |
79 | | -[issues-url]: https://github.com/haoxiangsnr/spiking-fullsubnet/issues |
80 | | -[license-shield]: https://img.shields.io/github/license/haoxiangsnr/spiking-fullsubnet.svg?style=for-the-badge |
81 | | -[license-url]: https://github.com/haoxiangsnr/spiking-fullsubnet/blob/master/LICENSE.txt |
| 155 | +This project is licensed under the [MIT License](LICENSE). |
0 commit comments