Jingchen Sun1, 2, Shaobo Han1, Wataru Kohno1, Changyou Chen2
1 NEC Labs America, USA
2 University at Buffalo, The State University of New York, USA
This repository contains the code and dataset for our paper CLAP-S: Support Set-Based Adaptation for Downstream Fiber-Optic Acoustic Recognition
. [Paper]
- Setup conda environment (recommended).
# Create a conda environment
conda create -n claps python=3.10 -y
# Activate the environment
conda activate clap
# Clone this repository
git clone [email protected]:Jingchensun/clap-s.git
cd clap-s
# Install torch
pip install -r requirement.txt
The Gunshot-Firework dataset originates from the paper Deep Learning-based Intrusion Detection and Impulsive Event Classification for Distributed Acoustic Sensing across Telecom Networks. We have restructured and released this dataset to facilitate the reproduction of the results presented in the paper. Below are some sample mel spectrograms generated from the audio recordings in this dataset.
Download the outdoor gunshot-firework fiber acoustic dataset from Google Drive and extract them to
tar -xvf gunshot_firework_data.tar.gz
The Final data structure should looks like:
data/
|–– coil_gunshot/
|–– coil_gunshot_train_labels.txt
|–– coil_gunshot_test_labels.txt
|–– fiber_gunshot/
|–– fiber_gunshot_train_labels.txt
|–– fiber_gunshot_test_labels.txt
This command runs the CLAP-Support on the recorded ESC50 dataset. You can modify the dataset and random seed.
sh clap_support.sh
Before running CLAP-S⁺, you need to obtain the weights of the 'Adapter,' which consists of two MLP layers. Use the command below to train a few-shot Adapter and save the checkpoint.
sh clap_adapter.sh
After obtaining the Adapter checkpoint, you can train the trainable audio feature Adapter in CLAP-S. Note that this implicit Adapter is different from the explicit Adapter you trained earlier. This highlights a key insight of our method: leveraging the few-shot data twice.
sh clap_support_plus.sh
Model | Training Type | 1-shot | 2-shot | 4-shot | 8-shot | Full shot |
---|---|---|---|---|---|---|
CLAP-S | Training-Free | 49.0 | 57.0 | 60.0 | 71.0 | 84.0 |
CLAP-S⁺ | Training-Required | 58.0 | 66.0 | 70.0 | 78.0 | 86.0 |
Model | Training Type | 0-shot | 2-shot | 4-shot | 8-shot | Full shot |
---|---|---|---|---|---|---|
CLAP-S | Training-Free | 57.0 | 65.0 | 67.0 | 72.0 | 85.0 |
CLAP-S⁺ | Training-Required | 62.0 | 68.0 | 67.0 | 69.0 | 87.0 |
If you have any questions regarding this repo, please contact Jingchen Sun ([email protected]).
If you find this repository useful, please consider giving a star ⭐ and citation
@article{sun2025clap,
title={CLAP-S: Support Set Based Adaptation for Downstream Fiber-optic Acoustic Recognition},
author={Sun, Jingchen and Han, Shaobo and Kohno, Wataru and Chen, Changyou},
journal={arXiv preprint arXiv:2501.09877},
year={2025}
}
@article{han2024deep,
title={Deep Learning-based Intrusion Detection and Impulsive Event Classification for Distributed Acoustic Sensing across Telecom Networks},
author={Han, Shaobo and Huang, Ming-Fang and Li, Tingfeng and Fang, Jian and Jiang, Zhuocheng and Wang, Ting},
journal={Journal of Lightwave Technology},
year={2024},
publisher={IEEE}
}