{"id":38521352,"url":"https://github.com/awsaf49/sonics","last_synced_at":"2026-01-17T06:41:04.580Z","repository":{"id":279702307,"uuid":"852519862","full_name":"awsaf49/sonics","owner":"awsaf49","description":"[ICLR 2025] SONICS: Synthetic Or Not - Identifying Counterfeit Songs","archived":false,"fork":false,"pushed_at":"2025-05-23T00:09:43.000Z","size":1838,"stargazers_count":15,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-23T01:26:39.442Z","etag":null,"topics":["audio-classification","cnn","deepfake-detection","fake-song-detection","music-dataset","transformer"],"latest_commit_sha":null,"homepage":"https://awsaf49.github.io/sonics-website/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awsaf49.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-05T00:20:59.000Z","updated_at":"2025-05-23T00:09:47.000Z","dependencies_parsed_at":"2025-02-27T00:23:14.648Z","dependency_job_id":"84a2e989-6247-4603-ae7b-f598c6c6281e","html_url":"https://github.com/awsaf49/sonics","commit_stats":null,"previous_names":["awsaf49/sonics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/awsaf49/sonics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awsaf49%2Fsonics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awsaf49%2Fsonics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awsaf49%2Fsonics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awsaf49%2Fsonics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awsaf49","download_url":"https://codeload.github.com/awsaf49/sonics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awsaf49%2Fsonics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28502813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-classification","cnn","deepfake-detection","fake-song-detection","music-dataset","transformer"],"created_at":"2026-01-17T06:41:02.756Z","updated_at":"2026-01-17T06:41:04.574Z","avatar_url":"https://github.com/awsaf49.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://i.postimg.cc/3Jx3yZ5b/real-vs-fake-sonics-w-logo.jpg\" width=\"250\"\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003eSONICS: Synthetic Or Not - Identifying Counterfeit Songs\u003c/h1\u003e\n    \u003ch3\u003e\u003cspan style=\"color:red;\"\u003e\u003cb\u003eICLR 2025 [Poster]\u003c/b\u003e\u003c/span\u003e\u003c/h3\u003e\n\n[![Paper](https://img.shields.io/badge/ArXiv-Paper-red)](https://arxiv.org/abs/2408.14080)\n[![Hugging Face](https://img.shields.io/badge/HuggingFace-Model-yellow)](https://huggingface.co/collections/awsaf49/sonics-spectttra-67bb6517b3920fd18e409013)\n[![Hugging Face Dataset](https://img.shields.io/badge/HuggingFace-Dataset-orange)](https://huggingface.co/datasets/awsaf49/sonics)\n[![Kaggle Dataset](https://img.shields.io/badge/Kaggle-Dataset-blue?logo=kaggle)](https://www.kaggle.com/datasets/awsaf49/sonics-dataset)\n[![Hugging Face Demo](https://img.shields.io/badge/HuggingFace-Demo-blue)](https://huggingface.co/spaces/awsaf49/sonics-fake-song-detection)\n[![Song Arena](https://img.shields.io/badge/HuggingFace-Song_Arena-blue)](https://huggingface.co/spaces/sonics-dl-group/sonics-song-arena)\n\u003c/div\u003e\n\nThis repository contains the official source code for our paper **SONICS: Synthetic Or Not - Identifying Counterfeit Songs**.\n\n---\n\n## 📌 Abstract\n\nThe recent surge in AI-generated songs presents exciting possibilities and challenges. These innovations necessitate the ability to distinguish between human-composed and synthetic songs to safeguard artistic integrity and protect human musical artistry. Existing research and datasets in fake song detection only focus on singing voice deepfake detection (SVDD), where the vocals are AI-generated\nbut the instrumental music is sourced from real songs. However, these approaches are inadequate for detecting contemporary end-to-end artificial songs where all components (vocals, music, lyrics, and style) could be AI-generated. Additionally, existing datasets lack music-lyrics diversity, long-duration songs, and open-access fake songs. To address these gaps, we introduce SONICS, a novel dataset\nfor end-to-end Synthetic Song Detection (SSD), comprising over 97k songs (4,751 hours) with over 49k synthetic songs from popular platforms like Suno and Udio. Furthermore, we highlight the importance of modeling long-range temporal dependencies in songs for effective authenticity detection, an aspect entirely overlooked in existing methods. To utilize long-range patterns, we introduce SpecTTTra, a novel architecture that significantly improves time and memory efficiency over conventional CNN and Transformer-based models. For long songs, our top-performing variant outperforms ViT by 8% in F1 score, is 38% faster, and uses 26% less memory, while also surpassing ConvNeXt with a 1% F1 score gain, 20% speed boost, and 67% memory reduction.\n\n---\n\n## 🎵 Spectro-Temporal Tokens Transformer (Spec🔱ra)\n\n![Model Architecture](sonics-specttra-v2.jpg)\n\n---\n\n## 🖥️ System Configuration\n\n- **Disk Space:** 150GB\n- **GPU Memory:** 48GB\n- **RAM:** 32GB\n- **Python Version:** 3.10\n- **OS:** Ubuntu 20.04\n- **CUDA Version:** 12.4\n\nThis is if you want to reproduce the results.\n---\n\n## 🚀 Installation\n\nFor training:\n```bash\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\nFor inference:\n```bash\npip install git+https://github.com/awsaf49/sonics.git\n```\n\n---\n\n## 📂 Dataset\n\nYou can download the dataset either from **Hugging Face** or **Kaggle**.\n\n### Download from Hugging Face:\n```python\nfrom huggingface_hub import snapshot_download\n\nsnapshot_download(repo_id=\"awsaf49/sonics\", repo_type=\"dataset\", local_dir=\"your_local_folder\")\n```\n\n### Download from Kaggle:\nFirst, set up the Kaggle API by following [this documentation](https://www.kaggle.com/docs/api).\n\nThen, run:\n```bash\nkaggle datasets download -d awsaf49/sonics-dataset --unzip\n```\n\n### Folder Structure:\n```\n├── dataset\n│   ├── fake_songs\n│   │   └── yyy.mp3\n│   ├── real_songs.csv\n│   └── fake_songs.csv\n```\n\n\u003e **Note:** This dataset contains **only fake songs**. For real songs, use the `youtube_id` from `real_songs.csv` to manually download them and place them inside `/dataset/real_songs/` folder.\n\n\n## Data Split \n\nTo split it into train, val, and test set, we will need to run the following command from the parent folder\n\n```shell\npython data_split.py\n```\n\n\u003e **Note:** The `real_songs.csv` and `fake_songs.csv` contain the metadata for the songs including duration, split, etc and config file contains path of the metadata.\n\n\u003e **Note:** Output files including checkpoints, model predictions will be saved in `./output/\u003cexperiment_name\u003e/` folder.\n\n---\n\n## 📜 Metadata Properties\n\n### `real_songs.csv`\n| Column Name        | Description |\n|--------------------|-------------|\n| `id`          | Unique file ID |\n| `filename`        | Name of the file |\n| `title`          | Title of the song |\n| `artist`        | Artist's name |\n| `year`          | Release year |\n| `lyrics`        | Lyrics of the song |\n| `lyrics_features` | Text features of lyrics extracted by LLM |\n| `duration`      | Total duration (seconds) |\n| `youtube_id`    | YouTube ID of real song (not provided as mp3) |\n| `label`         | \"real\" (all entries) |\n| `artist_overlap` | Whether train/test split contains the same artist |\n| `target`        | 0 (real songs) |\n| `skip_time`     | Instrumental-only duration before vocals (seconds) |\n| `no_vocal`      | Whether the song has vocals (`True/False`) |\n| `split`         | train/test/valid split |\n\n### `fake_songs.csv`\n| Column Name     | Description |\n|---------------|-------------|\n| `id`          | Unique file ID |\n| `filename`        | Name of the file |\n| `title`          | Title of the song |\n| `duration`      | Total duration (seconds) |\n| `algorithm`   | Algorithm used for generation |\n| `style`       | Characteristics of the song style |\n| `source`      | Generated from Suno or Udio |\n| `lyrics_features` | Text features of lyrics extracted by LLM |\n| `topic`       | Song theme (e.g., Star Trek, Pokémon) |\n| `genre`       | Song genre (e.g., salsa, grunge) |\n| `mood`        | Mood of the song (e.g., mournful, tense) |\n| `label`         | \"full fake\", \"half fake\", \"mostly fake\"|\n| `target`        | 1 (fake songs) |\n| `split`         | train/test/valid split |\n\n---\n\n## 🏋️ Training\n\n```bash\npython train.py --config \u003cpath_to_config_file\u003e\n```\n\nConfig files are available inside [`/configs`](/configs) folder.\n\n## 🔍 Testing\n\n```bash\npython test.py --config \u003cpath_to_config_file\u003e --ckpt_path \u003cpath_to_checkpoint_file\u003e\n```\n\n## 📊 Model Profiling\n\n```bash\npython model_profile.py --config \u003cpath_to_config_file\u003e --batch_size 12\n```\n\n---\n\n## 🏆 Model Performance\n\n| Model Name                     | HF Link | Variant        | Duration | f_clip | t_clip | F1  | Sensitivity | Specificity | Speed (A/S) | FLOPs (G) | Mem. (GB) | # Act. (M) | # Param. (M) |\n|--------------------------------|---------|---------------|----------|--------|--------|-----|-------------|-------------|-------------|-----------|-----------|------------|-------------|\n| `sonics-spectttra-alpha-5s`   | \u003ca class=\"hf-button\" href=\"https://huggingface.co/awsaf49/sonics-spectttra-alpha-5s\"\u003e\u003cimg src=\"https://huggingface.co/front/assets/huggingface_logo-noborder.svg\"\u003eHF\u003c/a\u003e  | SpecTTTra-α   | 5s       | 1      | 3      | 0.78 | 0.69        | 0.94        | 148         | 2.9       | 0.5       | 6          | 17          |\n| `sonics-spectttra-beta-5s`    | \u003ca class=\"hf-button\" href=\"https://huggingface.co/awsaf49/sonics-spectttra-beta-5s\"\u003e\u003cimg src=\"https://huggingface.co/front/assets/huggingface_logo-noborder.svg\"\u003eHF\u003c/a\u003e  | SpecTTTra-β   | 5s       | 3      | 5      | 0.78 | 0.69        | 0.94        | 152         | 1.1       | 0.2       | 5          | 17          |\n| `sonics-spectttra-gamma-5s`   | \u003ca class=\"hf-button\" href=\"https://huggingface.co/awsaf49/sonics-spectttra-gamma-5s\"\u003e\u003cimg src=\"https://huggingface.co/front/assets/huggingface_logo-noborder.svg\"\u003eHF\u003c/a\u003e  | SpecTTTra-γ   | 5s       | 5      | 7      | 0.76 | 0.66        | 0.92        | 154         | 0.7       | 0.1       | 2          | 17          |\n| `sonics-spectttra-alpha-120s` | \u003ca class=\"hf-button\" href=\"https://huggingface.co/awsaf49/sonics-spectttra-alpha-120s\"\u003e\u003cimg src=\"https://huggingface.co/front/assets/huggingface_logo-noborder.svg\"\u003eHF\u003c/a\u003e  | SpecTTTra-α   | 120s     | 1      | 3      | 0.97 | 0.96        | 0.99        | 47          | 23.7      | 3.9       | 50         | 19          |\n| `sonics-spectttra-beta-120s`  | \u003ca class=\"hf-button\" href=\"https://huggingface.co/awsaf49/sonics-spectttra-beta-120s\"\u003e\u003cimg src=\"https://huggingface.co/front/assets/huggingface_logo-noborder.svg\"\u003eHF\u003c/a\u003e  | SpecTTTra-β   | 120s     | 3      | 5      | 0.92 | 0.86        | 0.99        | 80          | 14.0      | 2.3       | 29         | 21          |\n| `sonics-spectttra-gamma-120s` | \u003ca class=\"hf-button\" href=\"https://huggingface.co/awsaf49/sonics-spectttra-gamma-120s\"\u003e\u003cimg src=\"https://huggingface.co/front/assets/huggingface_logo-noborder.svg\"\u003eHF\u003c/a\u003e  | SpecTTTra-γ   | 120s     | 5      | 7      | 0.88 | 0.79        | 0.99        | 97          | 10.1      | 1.6       | 20        | 24          |\n\n---\n\n## 🎶 Model Usage\n\n```python\n# Install from GitHub\npip install git+https://github.com/awsaf49/sonics.git\n\n# Load model\nfrom sonics import HFAudioClassifier\nmodel = HFAudioClassifier.from_pretrained(\"awsaf49/sonics-spectttra-gamma-5s\")\n```\n\n---\n\n## 🎵 Song Arena\n\nCan you detect if a song is AI-generated or real? Find out at our 🤗 [Song Arena](https://huggingface.co/spaces/sonics-dl-group/sonics-song-arena)!\n\n---\n\n## 📝 Citation\n\n```bibtex\n@inproceedings{rahman2024sonics,\n        title={SONICS: Synthetic Or Not - Identifying Counterfeit Songs},\n        author={Rahman, Md Awsafur and Hakim, Zaber Ibn Abdul and Sarker, Najibul Haque and Paul, Bishmoy and Fattah, Shaikh Anowarul},\n        booktitle={International Conference on Learning Representations (ICLR)},\n        year={2025},\n      }\n```\n\n---\n\n## 📜 License\n\nThis project is licensed under:\n- **MIT License** for code and models\n- **CC BY-NC 4.0 License** for the dataset\n\nSee [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawsaf49%2Fsonics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawsaf49%2Fsonics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawsaf49%2Fsonics/lists"}