Skip to content

Repository files navigation

Biological-Marker Deepfake Speech Detector (BIOSIG 2026 release)

Official implementation of the paper: An Initial Study of Physiological Markers for Deepfake Speech Detection (BIOSIG 2026).

Open-source detector that uses respiratory, vocal, and temporal biological markers for synthetic speech detection on long recordings (recommended ≥ 14 s). Respiratory markers build on the Respiro-en breath detector of Yang et al. (2024).

The code is dataset-agnostic: point it at your audio folder (or at pre-extracted marker tables) and run the top-level scripts. No specific corpus is required.

This repository provides open code, dataset documentation, and instructions to reproduce the experiments described in the paper (BIOSIG submission guidelines).

What is included

Component Location
User-facing CLIs train_detector.py, evaluate_detector.py, predict_audio.py
Marker extraction & modeling library src/dp_biomarkers/
Example recording index (paper corpus) data/eds14/
SHAP-like logreg analysis helper scripts/shap_linear_logreg_markers.py
Third-party wrappers (Respiro-en, augmentation) third_party/

Quick start

1. Install

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Tested on Linux/WSL2 with Python 3.10+.

GPU / CUDA (required for raw audio)

Marker extraction from raw audio (training, evaluation, and prediction on WAV/MP3/FLAC) requires an NVIDIA GPU with a CUDA-enabled PyTorch build.

Install PyTorch with CUDA matching your driver, for example:

pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu124

Then install the remaining dependencies from requirements.txt. If you pass pre-extracted marker CSVs or NPZ files to train_detector.py, extraction is skipped and CUDA is not needed for that step.

2. Prepare your dataset

Put audio files in a folder the scanner understands. The simplest layout:

MY_DATASET/
|-- real/          # bona fide (label 0)
`-- deepfake/      # spoof (label 1)

Combined multi-corpus trees (dataset_a/real, dataset_a/deepfake, …) are also supported - see src/dp_biomarkers/data/manifest_scan.py.

Recordings should be long enough for stable respiratory/temporal markers (≥ 14 s recommended).

3. Train

train_detector.py runs the full pipeline when you pass a raw audio directory: manifest creation, marker extraction, preprocessing, and classifier training.

python3 train_detector.py \
  --dataset /path/to/MY_DATASET \
  --classifier logreg \
  --lda

Outputs land under runs/train_<classifier>/<timestamp>/ (model, report, preprocessed markers).

Use --augment for waveform augmentation on train rows (raw audio only). Use --classifier svm for an RBF-SVM instead of logistic regression.

If you already have preprocessed marker NPZ files or raw marker CSVs (respiratory.csv, vocal.csv, temporal.csv), pass that directory as --dataset - training skips extraction.

4. Evaluate

python3 evaluate_detector.py \
  --model runs/train_logreg/<timestamp>/models/logreg \
  --dataset runs/train_logreg/<timestamp>/preprocessed

--model must point to a model you trained with train_detector.py: a models/logreg or models/svm directory, a full runs/train_* run directory, or a logreg_model.pkl / svm_model.pkl file.

5. Predict one file

python3 predict_audio.py \
  --model runs/train_logreg/<timestamp>/models/logreg \
  --audio /path/to/recording.wav \
  --marker-contribution

Custom manifest (optional)

If you already have a CSV with columns sample_id, file_path, label, split, use the lower-level CLIs under src/dp_biomarkers/cli/ (extract_hybrid, preprocess_features_category, train_logreg). The wrapper scripts above are the recommended default for new datasets.

Paper dataset (EDS-14)

Metadata for the English corpus used in the thesis is under data/eds14/ - see DATASET.md.

Repository layout

BIOSIG2026/
|-- README.md
|-- DATASET.md
|-- requirements.txt
|-- train_detector.py
|-- evaluate_detector.py
|-- predict_audio.py
|-- data/eds14/          
|-- scripts/
|-- src/dp_biomarkers/
`-- third_party/

Metrics

Evaluation reports EER and ROC-AUC per split. See report.json under the model output directory.

Marker families

Family Examples
Respiratory breath count, inhalation/exhalation statistics
Vocal F0, jitter, shimmer, HNR
Temporal speech rate, pause statistics, filler-word rate

See src/dp_biomarkers/features/common/thesis_markers.py for the full list.

License

This project is released under the MIT License; see the LICENSE file for details. Third-party code under third_party/ is redistributed under its own original license.

Acknowledgements

Respiratory-marker extraction relies on the Respiro-en breath detection model. We gratefully acknowledge the authors and refer readers to their work:

D. Yang, T. Koriyama, and Y. Saito, "Frame-Wise Breath Detection with Self-Training: An Exploration of Enhancing Breath Naturalness in Text-to-Speech," in Proc. INTERSPEECH, 2024. arXiv:2402.00288

Conference links

About

Physiological Markers for Deepfake Speech Detection

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages