This repository provides the preprocessing and baseline training code for the TAPS dataset. The code is written in PyTorch and uses the Huggingface Datasets library for data loading.
The TAPS (Throat and Acoustic Pairing Speech) dataset is a unique speech dataset designed to support deep learning-based throat microphone speech enhancement. It consists of paired utterances recorded using both throat microphones (capturing vibrations from the neck) and acoustic microphones (recording airborne speech). The dataset aims to improve speech clarity in high-noise environments where conventional microphones struggle.
The dataset is publicly available and can be downloaded from the Huggingface repository: TAPS Dataset 🤗
For more information on the dataset, please visit our project page on http://taps.postech.ac.kr/
The open-source hardware design and firmware for the TAPS recording device are available in a separate repository: taps_hardware
The repository includes:
- PCB designs (Altium Designer) for the main board (STM32F3 microcontroller + acoustic microphone) and neck-mounted sensor board (IIM42652 IMU)
- Firmware (STM32 C) for synchronized data acquisition and UART transmission
We provide the complete preprocessing and temporal-alignment pipeline used to prepare the TAPS dataset. The pipeline includes data collection, time synchronization with multiple alignment strategies, audio denoising, silence trimming, and sample rate alignment.
The scripts and sample data are located in the dataprepare/ directory.
| Step | Script | Description |
|---|---|---|
| 0 | step0_data_collector_gui.py |
Data collection from hardware via serial communication |
| 1 | step1_sync_audio.py |
Time synchronization with multiple alignment variants |
| 2 | step2_denoise_audio.py |
Audio denoising using Facebook's Denoiser model |
| 3 | step3_trim_by_energy.py |
Automatic silence trimming based on energy detection |
| 3.1 | step3_1_audio_slicer_gui.py |
Manual review and correction of trimmed audio |
| 4 | step4_upsample_throat.py |
Upsample accelerometer audio from 8 kHz to 16 kHz |
For detailed usage instructions, see the Data Preparation README.
Demucs is a deep learning-based speech enhancement model that employs a convolutional encoder-decoder architecture with U-Net-style skip connections. It integrates a bidirectional LSTM for sequence modeling, effectively capturing temporal dependencies in speech. The model is particularly effective at reconstructing lost speech features and improving intelligibility.
📄 Reference: Demucs GitHub Repository
TSTNN (Two-Stage Transformer-based Neural Network) is a masking-based model designed for time-domain speech enhancement. It utilizes a two-stage transformer module (TSTM) consisting of local and global transformers. These modules refine speech representations by preserving important components while suppressing noise. However, the model struggles to reconstruct missing voiceless sounds, limiting its effectiveness in certain speech enhancement tasks.
📄 Reference: TSTNN Paper on arXiv | TSTNN GitHub Repository
SE-Conformer is a speech enhancement model that combines convolutional and transformer-based architectures. It employs a Conformer block for sequence modeling, capturing both local and global dependencies in speech signals. The model demonstrates strong performance in enhancing speech clarity, particularly by effectively reconstructing high-frequency components and voiceless sounds.
📄 Reference: SE-Conformer Paper (ISCA Archive)
pip install -r requirements.txt
The evaluate.py script is used to evaluate the model on the test set. The script will evaluate the model performace in terms of PESQ, STOI, CSIG, CBAK, and COVL. You can also evaluate the model using the STT model to calculate the Character Error Rate (CER) and Word Error Rate (WER). The default model for the STT evaluation is the whisper-large-v3-turbo-korean model which is a fine-tuned version of the whisper-large-v3-turbo model on the Korean language. You can change the model by changing the enhance.py script.
python evaluate.py --config=<path to the model configuration file> --checkpoint=<path to the checkpoint> --log_file=<filename of log> --device=<device>
For more details regarding possible arguments, please see:
usage: evaluate.py [-h] [--config CONFIG] [--checkpoint CHECKPOINT] [--log_file LOG_FILE] [--device DEVICE] [--eval_stt]
optinal arguments:
-h, --help show this help message and exit
--config CONFIG Path to the model configuration file.
--checkpoint CHECKPOINT Path to the checkpoint directory. default is current directory
--log_file LOG_FILE Name of the log file. default is "evalute.log"
--eval_stt Evaluate the model using the STT model.
--device DEVICE Specifies the device (cuda or cpu). default is "cuda"
The enhance.py script is used to enhance the audio samples in the test set.
python enhance.py --config=<path to the model configuration file> --checkpoint=<path to the checkpoint> --output_dir=<sample directory> --device=<device>
For more details regarding possible arguments, please see:
usage: enhance.py [-h] [--config CONFIG] [--checkpoint CHECKPOINT] [--output_dir OUTPUT_DIR] [--device DEVICE]
optinal arguments:
-h, --help show this help message and exit
--config CONFIG Path to the model configuration file.
--checkpoint CHECKPOINT Path to the checkpoint directory. default is current directory
--output_dir OUTPUT_DIR Directory to save the enhanced samples. default is "samples"
--device DEVICE Specifies the device (cuda or cpu). default is "cuda"
We use Hydra to manage the configuration files. Hydra is a powerful tool for elegantly configuring complex applications. It composes and overrides configurations in a flexible way, making it easy to run multiple experiments with different configurations. See the Hydra Documentation for more information.
The train.py script is used to train the model on the TAPS dataset. The script will save the model checkpoints, logs, and tensorboard logs in the outputs directory. You can also override any parameter in the configuration file using the command line.
The configuration files are stored in the configs directory. You can train baseline models by selecting the configuration file for the model you want to train. For example, to train the SE-Conformer model, you can use the config_seconformer.yaml configuration file. If you want to change model parameters, you can override model configs in conf/model directory.
python train.py --config_name="config_$ModelName" $OverrideParams
--config_name: (required, str) – Name of the configuration file to use.$OverrideParams: (optional) – Override any parameter in the configuration file. For example,data.batch_size=16will override the batch_size parameter in the configuration file.
The default dataset used in this code is the TAPS dataset. You can train the model with your own dataset by changing the data.py and train.py scripts.
You can download the pretrained models from the following links: Google Drive