This repo is my attempt to solve the task Unsupervised Detection of Anomalous Sounds for Machine Condition Monitoring from the 2020 DCASE Challenge for pumps.
The repo has several Jupyter notebooks in the development folder and a Streamlit webpage in the production folder.
Anomalous sound detection (ASD) is the task to identify whether the sound emitted from a target machine is normal or anomalous.
Anomaly detection techniques can be categorized as:
- Supervised anomaly detection requires the entire dataset to be labeled "normal" or "abnormal". This technique is a binary classification task.
- Semi-supervised anomaly detection requires only data considered "normal" to be labeled. In this technique, the model will learn what "normal" data are like.
- Unsupervised anomaly detection involves unlabeled data. In this technique, the model will learn which data is "normal" and "abnormal".
Automatically detecting mechanical failure is an essential technology in the fourth industrial revolution. Prompt detection of machine anomaly by observing its sounds may be useful for machine condition monitoring.
In 2019, Hitachi released the MIMII dataset and one year later, the second task of the 2020 DCASE Challenge used a simplified version of the MIMII dataset.
For this project, I use only the development dataset for pumps from the 2020 DCASE Challenge. It contains 3349 audio files for training and 856 audio files for testing. Each recording is a single-channel 10-sec length audio that includes both a target machine's operating sound and environmental noise.
Although anomaly detection problems can be solved with supervised, semi-supervised and unsupervised anomaly detectors, the dataset that I used is only suitable for semi-supervised anomaly detectors.
I use Tensorflow, Tensorboard and Tensorflow serving to solve the problem.
To run the code, you need Docker and Docker Compose. There are two docker compose files.
- The docker compose file in the development folder will launch two containers: one for Jupyter and another for Tensorboard.
- The docker compose file in the production folder wiil launch two containers: one for the Streamlit app and another for Tensorflow serving.
You can run the docker compose files with VS Code and the Docker extension or with the command docker compose up. For instance:
docker compose up docker-compose.yaml
After you launch the containers, Docker will show the address for the Jupyter notebooks and the Streamlit web.
NOTE: The Streamlit app needs some files. You can run the notebook Files-for-Streamlit-app to create them or download them from here.
If you download them, you need to unzip the file you download in the frontend folder (production/frontend) to create a folder (store) that has three folders inside (audios, images, json).