Practical overview
When it fits
Use it when evaluating an authorized CTC-based ASR model against documented white-box attacks, or exploring adversarial robustness in speech recognition.
Who it is for
- Researchers studying adversarial machine learning for speech recognition.
- Developers assessing the robustness of ASR models they are authorized to evaluate.
Documented uses
- Generate targeted or untargeted adversarial inputs for an ASR model.
- Compare clean and adversarial speech recognition outputs.
- Measure a documented targeted BIM example using word error rate.
Requirements & limits
The project is a public GitHub repository under the Apache-2.0 license. The README documents installation from PyPI and Python 3.10+ with PyTorch 2.x.
- The documented backends target CTC modules, including torchaudio wav2vec2 and Hugging Face CTC models.
- The wav2vec2 example expects 16 kHz audio.
- Robust-mode Imperceptible attacks require a RoomSimulator; the
roomsextra installs pyroomacoustics for generating its rooms. - The README provides attack examples and a benchmark reference, but reported benchmark conditions should be consulted for model-specific performance.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up a wav2vec2-based ASR attack
Install the documented wav2vec2 extra and prepare the model, backend and attacker shown in the quickstart.
Before you start
- Python 3.10 or later and PyTorch 2.x
- A CUDA or CPU PyTorch wheel appropriate to your environment, installed first
- The package's wav2vec2 extra and torchaudio
Steps
Install a suitable PyTorch wheel, as directed by the PyTorch installation page.
Install the package with the command below.
pip install asr-attacks[wav2vec2]Load the documented torchaudio WAV2VEC2_ASR_BASE_960H model and create a CTCModuleBackend with the model, labels and selected device.
Wrap the backend with ASRAttacker; the documented example loads a waveform and expects a 16 kHz sample rate.
Expected outcome
The documented quickstart setup produces an ASRAttacker connected to a wav2vec2 CTC model, ready for the attack calls shown in the README.
Guide limitations
- The recipe stops at preparing the documented quickstart inputs and attacker; it does not claim an independent execution result.
- The shown waveform must have a 16 kHz sample rate.
- Use attacks only on models and data you are authorized to evaluate.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- hammaad2002/ASRAdversarialAttacks · Official homepage title · retained in its source language

