This system is designed to ingest IoT sensor data, process it for anomaly detection using Robust Random Cut Forests (RRCF), and store the data in a PostgreSQL database. The architecture utilizes MQTT for communication between edge devices and the processing system, Redis for queueing incoming messages, Python workers for processing the message queue, and Grafana for reporting and visualization.
This project was inspired by Operation Igloo White
- MQTT: Lightweight messaging protocol for communication between IoT devices and the processing system.
- Redis: In-memory data structure store used as a message broker for queueing MQTT messages.
- Python: Programming language used for developing the message processing workers.
- PostgreSQL: Open source relational database used for storing IoT sensor data.
- Robust Random Cut Forests (RRCF): Anomaly detection algorithm used for calculating timeseries anomaly scores.
- Grafana: Open source analytics and monitoring platform used for reporting and visualizations.
- Docker: Containerization platform used for deploying the demo environment.
- Docker Compose: Tool for defining and running multi-container Docker applications.
- MQTT Edge Devices: IoT sensors push sensor data using the MQTT protocol.
- MQTT Consumer: Messages from MQTT are pushed to Redis queues.
- Python Workers: Workers consume messages from Redis queues, process them, and persist the IoT sensor data in a PostgreSQL database.
- Anomaly Detection: RRCF algorithm is utilized to calculate timeseries anomaly scores.
- Reporting and Visualization: Grafana is used for reporting and visualizations, providing insights into the processed IoT sensor data.
The demo environment is deployed using Docker Compose, which simplifies the setup of the entire system. To deploy the demo:
- Clone the repository containing the Docker Compose configuration.
- Navigate to the directory containing the Docker Compose file.
- Run
docker-compose up
to start the containers. - Access Grafana at
http://localhost:3000
to view reports and visualizations.
- Edge devices should push sensor data using MQTT to the designated MQTT broker.
- Python workers will automatically consume messages from the Redis queues and process them for anomaly detection.
- Anomaly scores and processed data will be stored in the PostgreSQL database.
- Users can access Grafana for reporting and visualization of the IoT sensor data.
For the purposes of the demo, we created synthetic audio data as our sensor data by altering the UrbanSound8K dataset. This dataset was modified to simulate various environmental sounds captured by IoT sensors.
Contributions to the system are welcome! If you have any suggestions for improvements or would like to report issues, please open an issue or submit a pull request to the repository.
This system is licensed under the MIT License. See the LICENSE file for more details.