Python Boilerplate contains all the boilerplate you need to create a Python package.
Project description
Audio XAI
XAI for audio models
- GitHub | PyPI | Documentation
- Created by Piotr Kitłowski | GitHub @cncPomper | PyPI @pkitlo
- MIT License
Features
- TODO
Documentation
Documentation is built with Zensical and deployed to GitHub Pages.
- Live site: https://cncPomper.github.io/Audio-XAI/
- Preview locally:
just docs-serve(serves at http://localhost:8000) - Build:
just docs-build
API documentation is auto-generated from docstrings using mkdocstrings.
Docs deploy automatically on push to master via GitHub Actions. To enable this, go to your repo's Settings > Pages and set the source to GitHub Actions.
Setup
If you don't have ffmpeg installed, run:
Windows 11
winget install -e --id Gyan.FFmpeg
if you use conda, thats should enough
conda install -c conda-forge ffmpeg -y
Then verify the installation:
ffmpeg -version
ffprobe -version
Running tensorboard
tensorboard --logdir Audio-XAI/runs/ --port 6006 --bind_all
Examples
https://drive.google.com/drive/folders/1XD1rJwqSX-y-2OHzudYaatKE92MlYY8_?usp=sharing
Development
To set up for local development:
# Clone your fork
git clone git@github.com:your_username/Audio-XAI.git
cd Audio-XAI
# Install in editable mode with live updates
uv tool install --editable .
This installs the CLI globally but with live updates - any changes you make to the source code are immediately available when you run audio_xai.
Run tests:
uv run pytest
Run quality checks (format, lint, type check, test):
just qa
Author
Audio XAI was created in 2026 by Piotr Kitłowski.
Built with Cookiecutter and the audreyfeldroy/cookiecutter-pypackage project template.
1. General Information and Project Objective
The main objective of the project is to investigate the perceptual fragility of explanations (XAI methods) for deep learning models in the audio domain while keeping predictions unchanged.
2. Planned scope of experiments
- Datasets: Public datasets such as the Speech Commands Dataset (speech) and Sonics (synthetic/real music) will be used. The project will strictly ensure the immutability of the original data.
- Research models: Utilization and adaptation of audio recognition architectures: Audio Spectrogram Transformer, VGGish, Spectra, and ViT.
- XAI methods: Investigation of the vulnerability of gradient-based methods such as Grad-CAM and Integrated Gradients.
- Perceptual constraints: Instead of optimizing attacks against standard metrics, perceptual metrics will be considered (PESQ and STOI for speech, PEAQ for music).
- Computational resources and training: The project will require hardware acceleration (GPUs with a minimum of 16 GB VRAM). The estimated training and fine-tuning time for the base models is approximately 15 hours, while the main process of optimizing perceptual perturbations (XAI attack) for the entire test set is estimated to take an additional 25–30 hours of computation.
3. Planned Program Features
- Classification and Attribution Module: Reading models and generating explanation maps for them.
- Perturbation module: Generating subtle modifications to the audio signal with optimization that preserves high perceptual metrics (PESQ, PEAQ, STOI and ViSQOL).
- Deployment and Automation: Scripted building, testing, and deployment of applications using tools such as just and Python scripts built with typer or argparse.
- Final deliverables: The project will include clear documentation, user instructions, and tests relevant to the project’s scope.
4. Planned Technology Stack
The project will implement a robust base structure, automatically generated by tool cookiecutter.
- Environment management: Use of an isolated virtual environment managed by
uvorconda(SLURM-managed cluster will be used). - Code cleanliness: Enforced PEP8-compliant coding style with an increased line length limit. Syntax checking provided by an autoformatter and a linter using
ruff. - Version control: Rigorous use of a code repository with the
conventional commitsspecification implemented. - Frameworks and AI: Implementation of learning logic in dedicated frameworks such as
PyTorch Lightningin conjunction withHuggingfacelibraries. Code used for experiments will be continuously exported fromJupyter Labnotebooks into structured library code. - Experiments and configuration: Tracking progress, metrics, and logs using the
Tensorboardplatform. The configuration of model parameters and experiments will be completely separated from the execution code. - Documentation: Use of
mkdocsto fast and simple write documentation
5. Project schedule
| Deadline dates in 2026 | Planned scope of work and progress | Status |
|---|---|---|
| 30.03 - 05.04 | Repository configuration (Cookiecutter, Ruff, Uv). Defining the directory structure and ensuring that audio files remain immutable. | ✔ |
| 06.04 - 12.04 | Connecting W&B/TensorBoard. Training base classifiers using the PyTorch Lightning framework. (Estimated resource requirements: 15 hours of GPU computation) | ✔ |
| 13.04 - 19.04 | Implementation of explanation-generating (XAI) modules in clean code, after first exporting experiments from notebooks. Writing the first tests. | |
| 20.04 - 26.04 | Separating configuration from executable code. Preparing baseline attacks on attribution maps using standard distance metrics. | ✔ |
| 27.04 - 03.05 | Implementation of PESQ/STOI/PEAQ metric approximations directly into the attack optimization loop (generation of perceptual perturbations). | ✔ |
| 04.05 - 10.05 | Launch of the main research experiments on a dedicated cluster. (Estimated resource requirements: 25–30 hours of GPU computing for iterative processes). | ✔ |
| 11.05 - 17.05 | Scripting the execution of the entire experiment using the just tool and CLI libraries (e.g., typer). Aggregating tables containing the results. |
|
| 18.05 - 21.05 | Finalization of the work: creating documentation and clear instructions for using the finished system. Organizing the code in accordance with PEP8. | |
| 21.05 - 31.05 | Preparation of the paper(?) |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file audio_xai-0.0.2.post3.tar.gz.
File metadata
- Download URL: audio_xai-0.0.2.post3.tar.gz
- Upload date:
- Size: 390.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50e2bff0184ceeed4d26ef661b410fbd240aae0a03c03a89072103ee1575e26a
|
|
| MD5 |
b9f1dac815e7162e551951525fb0363a
|
|
| BLAKE2b-256 |
cb5234f9a68a413ba00555c6de1c8c2409acd4829712bbd0124c6d4e0314663b
|
Provenance
The following attestation bundles were made for audio_xai-0.0.2.post3.tar.gz:
Publisher:
publish.yml on cncPomper/Audio-XAI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
audio_xai-0.0.2.post3.tar.gz -
Subject digest:
50e2bff0184ceeed4d26ef661b410fbd240aae0a03c03a89072103ee1575e26a - Sigstore transparency entry: 1568005379
- Sigstore integration time:
-
Permalink:
cncPomper/Audio-XAI@9da98387ea8ded84e2f375e81e32944240f2b36d -
Branch / Tag:
refs/tags/v0.0.2.post3 - Owner: https://github.com/cncPomper
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9da98387ea8ded84e2f375e81e32944240f2b36d -
Trigger Event:
push
-
Statement type:
File details
Details for the file audio_xai-0.0.2.post3-py3-none-any.whl.
File metadata
- Download URL: audio_xai-0.0.2.post3-py3-none-any.whl
- Upload date:
- Size: 73.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e4c8a3b5ff3900a080eceeae582f7162a4fa4fb87f8e6180307cb576972a169
|
|
| MD5 |
7d7d52f59894571aa97e5683b471ebd6
|
|
| BLAKE2b-256 |
489776a7c423857cb1bbce964154fb22411bc7ca48a1f76cde5a789576aee8d3
|
Provenance
The following attestation bundles were made for audio_xai-0.0.2.post3-py3-none-any.whl:
Publisher:
publish.yml on cncPomper/Audio-XAI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
audio_xai-0.0.2.post3-py3-none-any.whl -
Subject digest:
4e4c8a3b5ff3900a080eceeae582f7162a4fa4fb87f8e6180307cb576972a169 - Sigstore transparency entry: 1568005587
- Sigstore integration time:
-
Permalink:
cncPomper/Audio-XAI@9da98387ea8ded84e2f375e81e32944240f2b36d -
Branch / Tag:
refs/tags/v0.0.2.post3 - Owner: https://github.com/cncPomper
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9da98387ea8ded84e2f375e81e32944240f2b36d -
Trigger Event:
push
-
Statement type: