{"id":29100662,"url":"https://github.com/bagustris/machinery-asd","last_synced_at":"2025-06-28T18:38:01.680Z","repository":{"id":243034998,"uuid":"811186426","full_name":"bagustris/machinery-asd","owner":"bagustris","description":"masd: machinery anomalous sound detection","archived":false,"fork":false,"pushed_at":"2024-11-01T04:34:39.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T05:23:20.566Z","etag":null,"topics":["anomaly-detection","idmt","mimii-dataset","sound-processing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bagustris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-06T05:35:32.000Z","updated_at":"2024-11-01T04:34:43.000Z","dependencies_parsed_at":"2024-11-01T05:32:26.414Z","dependency_job_id":null,"html_url":"https://github.com/bagustris/machinery-asd","commit_stats":null,"previous_names":["bagustris/idmt-asd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bagustris/machinery-asd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bagustris%2Fmachinery-asd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bagustris%2Fmachinery-asd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bagustris%2Fmachinery-asd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bagustris%2Fmachinery-asd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bagustris","download_url":"https://codeload.github.com/bagustris/machinery-asd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bagustris%2Fmachinery-asd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262478430,"owners_count":23317680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["anomaly-detection","idmt","mimii-dataset","sound-processing"],"created_at":"2025-06-28T18:37:58.781Z","updated_at":"2025-06-28T18:38:01.670Z","avatar_url":"https://github.com/bagustris.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anomaly sound detection with CCC Loss function\n\n## Downloading dataset\n\nFirst, you need to download the IDMT and MIMII datasets. I located these data\ninside `data` directory. If you locate them elsewhere, you need to adjust those paths (in `baseline.py`).\n\nLink for download:  \n\n- IDMT: \u003chttps://zenodo.org/record/7551261\u003e\n- MIMII Pump: \u003chttps://www.kaggle.com/datasets/senaca/mimii-pump-sound-dataset\u003e\n\n## Installation\nThe code is tested to work on Python 3.8; Python versions higher than 3.8 should work, too, although it is not tested. The following requirements for installation are only to make it work with my GPU and Python versions. As long as all required libraries can be installed, there should be no problem with running the program.\n\n```bash\npip install -r requirements.txt # gpu\npip install -r requirements-cpu.txt # cpu\n```\n\n## Running the code\n\nIDMT works out of the box with default MSE loss. You only need to run `baseline4.py`.\n\n```bash\n$ python baseline5.py\n...\nThe error threshold is set to be:  100.9849967956543\n              precision    recall  f1-score   support\n\n      Normal       0.99      0.70      0.82       669\n     Anomaly       0.77      0.99      0.87       665\n\n    accuracy                           0.85      1334\n   macro avg       0.88      0.85      0.84      1334\nweighted avg       0.88      0.85      0.84      1334\n\nConfusion Matrix\n[[468 201]\n [  5 660]]\nAUC:  0.8907133304112299\nPAUC:  0.6234260420936694\nExecution time: 39060.11 seconds\n```\n\nIf you want to evaluate the MIMII dataset, then use the argument `--dataset mimii`. If you want to use CCC loss function, then use argument `--loss ccc`. Finally, there is an option to use reassigned spectrogram feature in addition to the melspectrogram. Use argument`--feature reassigned`. By default, loss history, distribution of errors, and confusion matrix are not shown. Use argument`--plot` to show these figures.\n\n```bash\n$ python baseline5.py --dataset mimii --loss ccc --feature reassigned\n\n# Options:\n  --dataset DATASET  Dataset to use for training and testing  {idmt, mimii}\n  --feature FEATURE  Feature type to use for training and testing {mel, reassigned}\n  --loss LOSS        Loss function to use for training the model {mse, ccc, mae, mape}\n  --plot             Flag to plot the training loss (store true if flagged)\n  --seed SEED        Seed number (default to 42)\n```\n\n## Results\nSince I utilized GPU for training, the results is not reproducible. However, the results should be similar to the following if using CPU.\n  \n  ```bash\n  # ./baseline5.py  # CPU\nThe error threshold is set to be:  107.05306549072266\n              precision    recall  f1-score   support\n\n      Normal       0.95      0.72      0.82       669\n     Anomaly       0.78      0.96      0.86       665\n\n    accuracy                           0.84      1334\n   macro avg       0.86      0.84      0.84      1334\nweighted avg       0.86      0.84      0.84      1334\n\nConfusion Matrix\n[[485 184]\n [ 27 638]]\nAUC:  0.8304168492981331\nPAUC:  0.553538081692312\n\n  # ./run_mimii.sh # CPU\n  The error threshold is set to be:  624.5870361328125\n              precision    recall  f1-score   support\n\n      Normal       0.84      0.78      0.81       138\n     Anomaly       0.79      0.86      0.82       138\n\n    accuracy                           0.82       276\n   macro avg       0.82      0.82      0.81       276\nweighted avg       0.82      0.82      0.81       276\n\nConfusion Matrix\n[[107  31]\n [ 20 118]]\nAUC:  0.8997584541062801\nPAUC:  0.8226268254126179\n  ```\n\n## Citation\n\n```bibtex\nB.T. Atmaja, 2024. \"Evaluating Hyperparameter Optimization for Machinery Anomalous Sound Detection\", In proc. TENCON 2024 Singapore (Accepted, TBA)\n```\n\n## References:  \n\n1. \u003chttps://github.com/naveed88375/AI-ML/tree/master/Anomaly%20Detection%20in%20Industrial%20Equipment\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbagustris%2Fmachinery-asd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbagustris%2Fmachinery-asd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbagustris%2Fmachinery-asd/lists"}