Datasets:
Add files using upload-large-folder tool
Browse filesFiles changed (17)
- .gitattributes+1-59
- LICENSE.txtAdded+395
- README.mdAdded+97
- build_parquet.pyAdded+340
- data/labels.parquetAdded+3
- data/test-00000-of-00008.parquetAdded+3
- data/test-00001-of-00008.parquetAdded+3
- data/test-00002-of-00008.parquetAdded+3
- data/test-00003-of-00008.parquetAdded+3
- data/test-00004-of-00008.parquetAdded+3
- data/test-00005-of-00008.parquetAdded+3
- data/test-00006-of-00008.parquetAdded+3
- data/test-00007-of-00008.parquetAdded+3
- eval.yamlAdded+25
- push.pyAdded+38
- submissions/README.mdAdded+81
- submissions/results_template.yamlAdded+44
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.avro filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.lz4 filter=lfs diff=lfs merge=lfs -text*.mds filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text# Audio files - uncompressed*.pcm filter=lfs diff=lfs merge=lfs -text*.sam filter=lfs diff=lfs merge=lfs -text*.raw filter=lfs diff=lfs merge=lfs -text# Audio files - compressed*.aac filter=lfs diff=lfs merge=lfs -text*.flac filter=lfs diff=lfs merge=lfs -text*.mp3 filter=lfs diff=lfs merge=lfs -text*.ogg filter=lfs diff=lfs merge=lfs -text*.wav filter=lfs diff=lfs merge=lfs -text# Image files - uncompressed*.bmp filter=lfs diff=lfs merge=lfs -text*.gif filter=lfs diff=lfs merge=lfs -text*.png filter=lfs diff=lfs merge=lfs -text*.tiff filter=lfs diff=lfs merge=lfs -text# Image files - compressed*.jpg filter=lfs diff=lfs merge=lfs -text*.jpeg filter=lfs diff=lfs merge=lfs -text*.webp filter=lfs diff=lfs merge=lfs -text# Video files - compressed*.mp4 filter=lfs diff=lfs merge=lfs -text*.webm filter=lfs diff=lfs merge=lfs -text12*.tar.gz filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm anddoes not provide legal services or legal advice. Distribution ofCreative Commons public licenses does not create a lawyer-client orother relationship. Creative Commons makes its licenses and relatedinformation available on an "as-is" basis. Creative Commons gives nowarranties regarding its licenses, any material licensed under theirterms and conditions, or any related information. Creative Commonsdisclaims all liability for damages resulting from their use to thefullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms andconditions that creators and other rights holders may use to shareoriginal works of authorship and other material subject to copyrightand certain other rights specified in the public license below. Thefollowing considerations are for informational purposes only, are notexhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC- licensed material, or material used under an exception or limitation to copyright. More considerations for licensors: wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor's permission is not necessary for any reason--for example, because of any applicable exception or limitation to copyright--then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public: wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agreeto be bound by the terms and conditions of this Creative CommonsAttribution 4.0 International Public License ("Public License"). To theextent this Public License may be interpreted as a contract, You aregranted the Licensed Rights in consideration of Your acceptance ofthese terms and conditions, and the Licensor grants You such rights inconsideration of benefits the Licensor receives from making theLicensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a) (4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
b. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to thefollowing conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified form), You must:
a. retain the following if it is supplied by the Licensor with the Licensed Material:
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
b. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights thatapply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does notreplace Your obligations under this Public License where the LicensedRights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public licenses.Notwithstanding, Creative Commons may elect to apply one of its publiclicenses to material it publishes and in those instances will beconsidered the “Licensor.” The text of the Creative Commons publiclicenses is dedicated to the public domain under the CC0 Public DomainDedication. Except for the limited purpose of indicating that materialis shared under a Creative Commons public license or as otherwisepermitted by the Creative Commons policies published atcreativecommons.org/policies, Creative Commons does not authorize theuse of the trademark "Creative Commons" or any other trademark or logoof Creative Commons without its prior written consent including,without limitation, in connection with any unauthorized modificationsto any of its public licenses or any other arrangements,understandings, or agreements concerning use of licensed material. Forthe avoidance of doubt, this paragraph does not form part of the publiclicenses.
Creative Commons may be contacted at creativecommons.org.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697---license: cc-by-4.0language: - en - zhpretty_name: DECRO (eval)task_categories: - audio-classificationsize_categories: - 10K<n<100Kconfigs: - config_name: default data_files: - split: test path: "data/test-*.parquet"tags: - anti-spoofing - audio-deepfake-detection - speech - benchmark - arena-readyarxiv: - "10.1145/3543507.3583222"---
# DECRO (eval)
Benchmark-ready packaging of the **evaluation partition** of the **DECRO** (DEepfake CROss-lingual) dataset — a cross-lingual (English + Chinese) speech anti-spoofing / synthetic-voice detection benchmark from *Transferring Audio Deepfake Detection Capability across Languages* (TheWebConf / WWW 2023).
## Overview
DECRO pairs an English and a Chinese subset whose spoofed speech is generated with the **same** synthesis algorithms, so it isolates the effect of language on deepfake detection. The task is binary classification: **bonafide** (genuine human speech) vs. **spoof** (TTS / VC synthetic speech). This packaging contains the **eval** split of **both** language subsets, combined into a single test set. The original dataset is at https://github.com/petrichorwq/DECRO-dataset.
## License & redistribution
Redistributed under the **Creative Commons Attribution 4.0 International (CC BY 4.0)** license — the upstream DECRO license. See `LICENSE.txt`. CC BY 4.0 permits redistribution and derivative works with attribution. Labels and the evaluation protocol are unmodified; the audio was decoded and re-encoded to canonical 16 kHz mono FLAC (the source mixes sampling rates — 16 / 22.05 / 24 / 44.1 kHz — and a few FLOAT-subtype WAVs, so a uniform 16 kHz re-encode is required for evaluation).
## Schema
| Column | Type | Description ||--------|------|-------------|| `path` | `string` | `<utterance_id>.flac`, unique || `audio` | `Audio(16000)` | 16 kHz mono FLAC || `label` | `ClassLabel` | `"bonafide"` (0) / `"spoof"` (1) || `notes` | `string` | JSON: `utterance_id`, `language`, `speaker_id`, `system_id` |
`utterance_id` is the **language-prefixed** filename stem (`en_<stem>` / `ch_<stem>`); raw stems are not globally unique across the two subsets, so the prefix is the stable join key. `system_id` is the spoof algorithm (e.g. `hifigan`, `vits`, `baidu_en`) or, for bonafide, the source corpus (e.g. `asv19`, `aishell1`).
`notes` example:```json{"utterance_id": "en_1-4993-40677-0048", "language": "en", "speaker_id": "1", "system_id": "baidu_en"}```
## Quick Start
```pythonfrom datasets import load_dataset
ds = load_dataset("SpeechAntiSpoofingBenchmarks/DECRO", split="test")print(ds[0])```
## Stats
| Stat | Value ||------|-------|| Total trials | 37,314 || Bonafide | 10,415 || Spoof | 26,899 || English (en_eval) | 19,190 (4,306 bonafide / 14,884 spoof) || Chinese (ch_eval) | 18,124 (6,109 bonafide / 12,015 spoof) |
## Source provenance
- Original repository: https://github.com/petrichorwq/DECRO-dataset- Protocols: `en_eval.txt`, `ch_eval.txt` (format: `SPEAKER_ID AUDIO_FILE_NAME - SYSTEM_ID KEY`)- Bonafide: ASVspoof2019 LA (English); Aidatatang/Aishell/freeST/MagicData (Chinese). Spoof: WaveFake, FAD, and TTS/VC systems (Tacotron, FastSpeech2, VITS, StarGANv2-VC, NVC-Net, HiFiGAN, MB-MelGAN, PWG, Baidu, Xunfei).
## Evaluation
For evaluation instructions and submission format, see [`submissions/README.md`](submissions/README.md).
## Citation
```bibtex@inproceedings{ba2023transferring, title = {Transferring Audio Deepfake Detection Capability across Languages}, author = {Ba, Zhongjie and Wen, Qing and Cheng, Peng and Wang, Yuwei and Lin, Feng and Lu, Li and Liu, Zhenguang}, booktitle = {Proceedings of the ACM Web Conference 2023 (WWW '23)}, year = {2023}, doi = {10.1145/3543507.3583222},}```
## Maintainer
Contact: k.n.borodin@mtuci.ru123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340"""Parquet build for the DECRO (eval) HF dataset repo.
Reads the DECRO **eval** partitions of both language subsets -- English(``en_eval/`` + ``en_eval.txt``) and Chinese (``ch_eval/`` + ``ch_eval.txt``) --and emits the canonical 4-column schema (path / audio / label / notes) shardedinto NUM_SHARDS parquet files.
Always re-encode----------------The DECRO source audio is single-channel WAV but at *mixed* sampling rates(16 k / 22.05 k / 24 k / 44.1 k observed) with a handful of FLOAT-subtype WAVs.The arena requires a common 16 kHz SR and the HF ``datasets`` Audio decoder /validator / models all decode through soundfile, so we take the re-encode pathunconditionally: Stage 1 loads EVERY clip with librosa (which also serves as thewhole-set decodability probe) and writes a clean 16 kHz mono FLAC into a stagingdir; Stage 2 assembles the shards from those clean files. librosa readsFLOAT-subtype WAV correctly (no int16 zero-out).
Unique join key---------------Raw filename stems are NOT globally unique across the two subsets(``test_050_102`` / ``test_050_105`` exist in both en and ch). The immutable``utterance_id`` is therefore language-prefixed: ``{lang}_{stem}`` (lang in{en, ch}). ``path`` = ``{utterance_id}.flac``.
Two stages, fully parallel, resumable. Stage 1 skips files already staged, so akilled run resumes at file granularity. The staging dir is gitignored.
Sample mode (--limit N): first N rows into a single shard, skipping thefull-count asserts -- used for the fast offline validate-dataset pass."""
import argparseimport ioimport jsonimport osimport tempfileimport warningsfrom concurrent.futures import ProcessPoolExecutorfrom pathlib import Path
# Mixed-rate source: librosa may fall back to audioread for some clips and emit# a PySoundFile UserWarning + librosa FutureWarning. Silence so the build log# stays readable.warnings.filterwarnings("ignore", message="PySoundFile failed")warnings.filterwarnings("ignore", category=FutureWarning, module="librosa")
import datasets # noqa: E402import librosa # noqa: E402import pyarrow.parquet as pq # noqa: E402import soundfile as sf # noqa: E402from datasets import Audio, ClassLabel, Dataset, Features, Value # noqa: E402from tqdm.auto import tqdm # noqa: E402
try: datasets.disable_progress_bars()except AttributeError: from datasets.utils.logging import disable_progress_bar
disable_progress_bar()
REPO_ROOT = Path(__file__).resolve().parentSRC_ROOT = Path("/home/kirill/mnt/users_4tb/datasets/petrichorwq-DECRO-dataset-6fc9884")# (language, eval audio dir, eval protocol file)SPLITS = [ ("en", SRC_ROOT / "en_eval", SRC_ROOT / "en_eval.txt"), ("ch", SRC_ROOT / "ch_eval", SRC_ROOT / "ch_eval.txt"),]PARQUET_DIR = REPO_ROOT / "data"STAGING_DIR = REPO_ROOT / "_clean_flac"NUM_SHARDS = 8EXPECTED_ROWS = 37314EXPECTED_BONAFIDE = 10415EXPECTED_SPOOF = 26899TARGET_SR = 16000WORKERS = int(os.environ.get("DECRO_BUILD_WORKERS", os.cpu_count() or 4))
FEATURES = Features( { "path": Value("string"), "audio": Audio(sampling_rate=16000), "label": ClassLabel(names=["bonafide", "spoof"]), "notes": Value("string"), })
def parse_metadata(): """Parse both eval protocols.
Row format: ``SPEAKER_ID AUDIO_FILE_NAME - SYSTEM_ID KEY`` (col 3 unused). Returns records with a language-prefixed unique ``uid``. """ records = [] for lang, audio_dir, proto in SPLITS: with open(proto, encoding="utf-8") as fh: for line in fh: line = line.strip() if not line: continue parts = line.split() if len(parts) != 5: raise ValueError(f"Expected 5 columns, got {len(parts)}: {line!r}") speaker, name, _unused, system_id, label = parts if label not in ("bonafide", "spoof"): raise ValueError(f"Unexpected label {label!r}: {line!r}") records.append( { "lang": lang, "name": name, "uid": f"{lang}_{name}", "src": audio_dir / f"{name}.wav", "speaker": speaker, "system_id": system_id, "label": label, } ) return records
def build_notes(rec): return json.dumps( { "utterance_id": rec["uid"], "language": rec["lang"], "speaker_id": rec["speaker"], "system_id": rec["system_id"], } )
def _clip_duration(rec): info = sf.info(str(rec["src"])) return info.frames / info.samplerate
def _ensure_long_first_row(records): """Swap a clip with duration >= 1.0s to index 0 (validator D3 checks row 0).""" for i in range(len(records)): if _clip_duration(records[i]) >= 1.0: if i != 0: records[0], records[i] = records[i], records[0] return raise RuntimeError("No clip with duration >= 1.0s found")
def _reencode_worker(task): """Re-encode one source WAV into the staging dir. Resumable + atomic.
librosa decodes (handles mixed SR + FLOAT-subtype WAV correctly) and resamples to 16 kHz mono; soundfile writes a clean FLAC. Writes to a temp name then os.replace so a killed run never leaves a half-written file. """ uid, src = task dst = STAGING_DIR / f"{uid}.flac" if dst.exists() and dst.stat().st_size > 0: return (uid, None) try: y, _ = librosa.load(str(src), sr=TARGET_SR, mono=True) if y.shape[0] == 0: return (uid, "empty after decode") tmp = STAGING_DIR / f".{uid}.flac.tmp" sf.write(str(tmp), y, TARGET_SR, format="FLAC") os.replace(tmp, dst) return (uid, None) except Exception as e: # noqa: BLE001 return (uid, str(e).splitlines()[0][:120])
def stage1_reencode(records): """Re-encode all source WAV into STAGING_DIR across all cores (resumable).
This is also the whole-set decodability probe: any clip librosa cannot load aborts the build. """ STAGING_DIR.mkdir(parents=True, exist_ok=True) tasks = [(r["uid"], r["src"]) for r in records] total = len(tasks) print(f"Stage 1: re-encoding {total} files with {WORKERS} workers -> {STAGING_DIR}") failures = [] with ProcessPoolExecutor(max_workers=WORKERS) as ex: for uid, err in tqdm( ex.map(_reencode_worker, tasks, chunksize=64), total=total, desc="Stage 1 re-encode", unit="file", ): if err: failures.append((uid, err)) print(f"Stage 1 done: {total} processed, {len(failures)} failures") if failures: for uid, err in failures[:10]: print(f" FAIL {uid}: {err}") raise RuntimeError(f"{len(failures)} files failed to re-encode")
def _build_shard(task): """Worker: build one shard parquet from its row slice. Resumable + atomic.""" shard_index, rows, num_shards = task shard_name = f"test-{shard_index:05d}-of-{num_shards:05d}.parquet" final = PARQUET_DIR / shard_name if final.exists() and final.stat().st_size > 0: return (shard_index, len(rows), "skipped")
def row_gen(): for rec in rows: uid = rec["uid"] yield { "path": f"{uid}.flac", "audio": { "bytes": (STAGING_DIR / f"{uid}.flac").read_bytes(), "path": f"{uid}.flac", }, "label": rec["label"], "notes": build_notes(rec), }
with tempfile.TemporaryDirectory() as cache: ds = Dataset.from_generator(row_gen, features=FEATURES, cache_dir=cache) tmp = PARQUET_DIR / f".{shard_name}.tmp" ds.to_parquet(str(tmp)) os.replace(tmp, final) return (shard_index, len(rows), "built")
def _partition(records, num_shards): n = len(records) per = (n + num_shards - 1) // num_shards out = [] for i in range(num_shards): chunk = records[i * per : (i + 1) * per] if chunk: out.append(chunk) return out
def build(): parser = argparse.ArgumentParser() parser.add_argument("--limit", type=int, default=None) args = parser.parse_args() limit = args.limit sample_mode = limit is not None
print("Reading metadata from", ", ".join(str(p) for _, _, p in SPLITS)) records = parse_metadata() print(f"Parsed {len(records)} rows") if not sample_mode: assert len(records) == EXPECTED_ROWS, f"Expected {EXPECTED_ROWS}, got {len(records)}"
check = records if not sample_mode else records[: max(limit * 4, limit)] missing = [r["uid"] for r in check if not r["src"].exists()] assert not missing, f"{len(missing)} wav files missing, e.g. {missing[:5]}"
records.sort(key=lambda r: r["uid"]) _ensure_long_first_row(records)
if sample_mode: records = records[:limit] num_shards = 1 print(f"SAMPLE MODE: {len(records)} rows -> 1 shard") else: num_shards = NUM_SHARDS
bona = sum(1 for r in records if r["label"] == "bonafide") spoof = sum(1 for r in records if r["label"] == "spoof") print(f" bonafide={bona} spoof={spoof} total={len(records)}")
# Stage 1: parallel re-encode to the staging dir (resumable + whole-set probe). stage1_reencode(records)
# Stage 2: assemble parquet shards (one worker per shard). PARQUET_DIR.mkdir(parents=True, exist_ok=True) keep_suffix = f"-of-{num_shards:05d}.parquet" for stale in PARQUET_DIR.glob("test-*.parquet"): if not stale.name.endswith(keep_suffix): print(f"Removing stale shard {stale.name}") stale.unlink() shards = _partition(records, num_shards) tasks = [(i, rows, num_shards) for i, rows in enumerate(shards)] stage2_workers = min(WORKERS, len(tasks)) print(f"Stage 2: building {len(tasks)} shard(s) with {stage2_workers} workers...") built = skipped = 0 with ProcessPoolExecutor(max_workers=stage2_workers) as ex: for idx, n, status in tqdm( ex.map(_build_shard, tasks), total=len(tasks), desc="Stage 2 shards", unit="shard", ): if status == "built": built += 1 elif status == "skipped": skipped += 1 print(f"Stage 2 done: {built} built, {skipped} skipped")
_verify(num_shards, sample_mode) print("All verifications passed!")
if not sample_mode: from speech_spoof_bench import labels
out = labels.emit_labels(REPO_ROOT) print(f"Wrote {out}")
def _verify(num_shards, sample_mode): shards = sorted(PARQUET_DIR.glob("test-*.parquet")) total = sum(pq.read_metadata(str(f)).num_rows for f in shards) uid_set, path_set, bona, spoof = set(), set(), 0, 0 for f in shards: t = pq.read_table(str(f), columns=["path", "label", "notes"]) for p, lab, n in zip( t.column("path").to_pylist(), t.column("label").to_pylist(), t.column("notes").to_pylist(), ): path_set.add(p) uid_set.add(json.loads(n)["utterance_id"]) if lab == 0: bona += 1 elif lab == 1: spoof += 1 assert len(uid_set) == total, "Duplicate utterance_ids" assert len(path_set) == total, "Duplicate paths" if not sample_mode: assert total == EXPECTED_ROWS, f"{total} != {EXPECTED_ROWS}" assert bona == EXPECTED_BONAFIDE, f"bonafide {bona} != {EXPECTED_BONAFIDE}" assert spoof == EXPECTED_SPOOF, f"spoof {spoof} != {EXPECTED_SPOOF}" t0 = pq.read_table(str(shards[0])) assert set(t0.column_names) == {"path", "audio", "label", "notes"}, t0.column_names audio0 = t0.column("audio")[0].as_py() data, sr = sf.read(io.BytesIO(audio0["bytes"])) dur = len(data) / sr assert sr == 16000, f"row0 sr {sr} != 16000" assert dur >= 1.0, f"row0 dur {dur:.2f}s < 1.0s" print(f" verify: {total} rows, row0 {sr}Hz {dur:.2f}s decodable OK")
if __name__ == "__main__": build()123version https://git-lfs.github.com/spec/v1oid sha256:696e58af8ad4dda1f6b20d814b1c1191bca8f50c08abf95115d432444b646673size 305937123version https://git-lfs.github.com/spec/v1oid sha256:7bca1a6ccc778f694272e08d115fd434980e9d05e045d73a3ad830da50f08584size 297138971123version https://git-lfs.github.com/spec/v1oid sha256:ee31ff9aa2cd4f8f0dcbf059cb0d0a4ee16e65f11d29c5dc57bcab4eceec1d99size 274933241123version https://git-lfs.github.com/spec/v1oid sha256:83c17607b4792b61c5ded6ab0d993d50df6060c7fbf0c31761d4876ae80271e0size 263649867123version https://git-lfs.github.com/spec/v1oid sha256:c57363e2c4d137562a06bc4099a5e74ea50a13ed6f76d48dd8261adc5c532bc3size 318446826123version https://git-lfs.github.com/spec/v1oid sha256:523038acd68abc9e66df9ec0156fa76bcd901031fed14510ad4bf6be4ae81d74size 269206865123version https://git-lfs.github.com/spec/v1oid sha256:29e615cdf55cdc351c3ac49d307becfce6baa852a434365178eb126314fcce71size 368350940123version https://git-lfs.github.com/spec/v1oid sha256:cf3f58b3bac805ec8b6d63e443bf17262682fd59d8f89ec1423e620ef5de1decsize 619237269123version https://git-lfs.github.com/spec/v1oid sha256:11aebf764dfbc479afe837c075e0f5d66ef3200b8f1faf0892033ecc02a4c5d6size 32966819812345678910111213141516171819202122232425name: DECROdescription: > Evaluation partition of the DECRO (DEepfake CROss-lingual) dataset, English + Chinese subsets combined. Binary classification: bonafide vs. spoof, where the two languages share the same set of TTS/VC synthesis algorithms. EER computed on the combined eval protocol (37,314 utterances).evaluation_framework: inspect-ai
tasks: - id: antispoofing_eval config: default split: test
field_spec: input: audio target: label
solvers: - name: speech_spoof_bench_solver
scorers: - name: speech_spoof_scorer
metrics: - eer_percent1234567891011121314151617181920212223242526272829303132333435363738"""Push the built DECRO dataset to the HF Hub (resumable, proxy-free).
Run with the network proxy unset for the >1 GB shard upload: env -u HTTP_PROXY -u HTTPS_PROXY -u http_proxy -u https_proxy python push.py"""
from pathlib import Path
from huggingface_hub import HfApi
REPO_ID = "SpeechAntiSpoofingBenchmarks/DECRO"FOLDER = Path(__file__).resolve().parent
IGNORE = [ "_clean_flac/**", "__pycache__/**", "*.pyc", ".cache/**", ".git/**", ".gitignore",]
def main(): api = HfApi() api.create_repo(REPO_ID, repo_type="dataset", exist_ok=True) api.upload_large_folder( repo_id=REPO_ID, repo_type="dataset", folder_path=str(FOLDER), ignore_patterns=IGNORE, ) info = api.dataset_info(REPO_ID) print("Pushed. Latest commit SHA:", info.sha)
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081# Benchmark Submissions
To submit a result, you'll upload two files (no git clone required):
1. **`scores.txt`** to **your own HF model repo** under `.eval_results/SpeechAntiSpoofingBenchmarks/ASVspoof2019_LA/scores.txt`.2. **`<your-slug>.yaml`** as a pull request to **this dataset repo** under `submissions/<your-slug>.yaml`.
The YAML in this repo carries a pinned URL pointing at your `scores.txt`, plus its sha256. Scores files do not live in this repo.
## Submitter workflow
### 1. Generate `scores.txt` locally
```bashspeech-spoof-bench run \ --model-module <your_package>:<YourModelClass> \ --datasets SpeechAntiSpoofingBenchmarks/ASVspoof2019_LA```
Output: `results/ASVspoof2019_LA/scores.txt` (one line per utterance, `<utterance_id> <score>`, higher = more bonafide).
### 2. Upload `scores.txt` to your model repo
```bashhuggingface-cli upload <your-owner>/<your-model-repo> \ results/ASVspoof2019_LA/scores.txt \ .eval_results/SpeechAntiSpoofingBenchmarks/ASVspoof2019_LA/scores.txt \ --repo-type=model \ --commit-message="Add ASVspoof2019_LA scores"```
**Note the commit sha** the CLI prints — you'll need it in the next step.
### 3. Fill in the submission YAML
Copy `results_template.yaml` to `<your-slug>.yaml` and fill in every field. The two most important fields:
- `artifact.scores_url`: the **pinned** URL to your uploaded scores file. Use the commit sha from step 2, not `main`: ``` https://huggingface.co/<your-owner>/<your-model-repo>/resolve/<commit-sha-from-step-2>/.eval_results/SpeechAntiSpoofingBenchmarks/ASVspoof2019_LA/scores.txt ``` URLs with `/resolve/main/` are rejected because they're mutable.- `artifact.scores_sha256`: `sha256sum results/ASVspoof2019_LA/scores.txt | awk '{print $1}'`.
Leave the `reproduction:` block empty — the maintainer fills it in at merge time.
### 4. Open the PR via HF CLI
```bashhuggingface-cli upload \ SpeechAntiSpoofingBenchmarks/ASVspoof2019_LA \ <your-slug>.yaml submissions/<your-slug>.yaml \ --repo-type=dataset \ --create-pr \ --commit-message="Add <your-slug> submission"```
The CLI prints a PR URL. That's it.
### 5. Wait for maintainer reproduction
A maintainer runs `speech-spoof-bench reproduce --scoring <PR-branch>`, which:- Fetches `scores_url`.- Verifies the sha256 against `artifact.scores_sha256`.- Recomputes EER from the file.- Compares to your claimed `scores.eer_percent` (must match within 1e-6).
If it passes, the maintainer fills in `reproduction:` and merges. If it fails, you get a comment on the PR explaining why.
## Verification levels
| Level | What the maintainer checks | Cost ||---|---|---|| `scoring` (default) | sha + recomputed EER from your `scores.txt`. | Seconds. || `inference` (optional, follow-up) | Re-runs your checkpoint end-to-end and regenerates `scores.txt`. Must match within 0.05% EER. | Expensive. |
Submissions without a `reproduction:` block never appear in the arena.
## What about git clone + push?
You can do it that way too, but for a single 2 KB YAML it's massively heavier. The HF CLI path is the documented one.1234567891011121314151617181920212223242526272829303132333435363738394041424344schema_version: 4
system: name: "" slug: "" description: "" code: "" checkpoint: "" paper: arxiv_id: "" url: "" bibtex: | @article{...}
dataset: id: SpeechAntiSpoofingBenchmarks/ASVspoof2019_LA revision: "" split: test
scores: eer_percent: 0.0 n_trials: 71237 n_skipped: 0
artifact: # Must be pinned by commit sha. Pattern: # https://huggingface.co/<owner>/<repo>/resolve/<commit-sha>/.eval_results/SpeechAntiSpoofingBenchmarks/ASVspoof2019_LA/scores.txt scores_url: "" scores_sha256: "" bench_version: ""
# Leave this block empty — the maintainer fills it in at merge.reproduction: reproduced_by: "" reproduced_at: "" reproduced_bench_version: "" match: ""
submitter: hf_username: "" contact: ""
submitted_at: ""notes: "".gitattributes+1-59
LICENSE.txtAdded+395
README.mdAdded+97
build_parquet.pyAdded+340
data/labels.parquetAdded+3
data/test-00000-of-00008.parquetAdded+3
data/test-00001-of-00008.parquetAdded+3
data/test-00002-of-00008.parquetAdded+3
data/test-00003-of-00008.parquetAdded+3
data/test-00004-of-00008.parquetAdded+3
data/test-00005-of-00008.parquetAdded+3
data/test-00006-of-00008.parquetAdded+3
data/test-00007-of-00008.parquetAdded+3
eval.yamlAdded+25
push.pyAdded+38
submissions/README.mdAdded+81
submissions/results_template.yamlAdded+44