Skip to content

Docker-based simulation of edge nodes running unsupervised anomaly detection for industrial fleet environments.

License

Notifications You must be signed in to change notification settings

Shyam-Sundar-Raju/EdgeSim_Anomaly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fleet Anomaly Detection — Edge ⇢ Fog ⇢ Cloud (Simulation using Docker)

This repo simulates a edge-based architecture using Python + Docker:

  • Edge (STM32/RPi simulated): 3 containers publishing sensor data to MQTT.
  • Fog (Industrial PC): aggregates fleet data, computes simple z-score anomalies, publishes actuator commands.
  • Cloud (AWS/Azure/GCP simulated): Streamlit dashboard subscribing to MQTT and visualizing fleet status.
  • Broker: Eclipse Mosquitto (MQTT).

Quick Start

# 1) cd into the folder
cd EdgeSim_Anomaly

# 2) Launch the stack
sudo docker-compose up --build

# 3) Open the dashboard
#    http://localhost:8501

# 4) Closing the connections
#     Ctrl+C
sudo docker-compose down

You should see edge1/2/3 printing actuator commands when anomalies are detected, and the Cloud dashboard will show real-time reports.

Topics

  • Edge publishes:
    • edge/{edge_id}/sensors → JSON with temperature, humidity, pressure, electrical, vibration
    • edge/{edge_id}/heartbeat
  • Fog publishes:
    • fog/actuators/{edge_id} → JSON commands (e.g., { "alarm": true })
    • cloud/reports → JSON status per edge
    • cloud/fleet_snapshot → fleet-level snapshot

Tuning

  • fog service env:
    • WINDOW_SIZE (default 50 samples)
    • Z_THRESH (default 2.5)
  • edge services env:
    • ANOMALY_RATE (probability of anomaly injection per message)

Extending Toward the Paper

This simulation uses the knowledge gained from the paper A general anomaly detection framework for fleet-based condition monitoring of machines by Kilian Hendrickx, Wannes Meert, Yves Mollet, Johan Gyselinck, Bram Cornelis, Konstantinos Gryllias, Jesse Davis https://doi.org/10.1016/j.ymssp.2019.106585

  • Replace fog z-score logic with:
    • DTW/W-DTW warping amount between edges (Block 1)
    • Hierarchical clustering + cophenetic correlation to pick clusters (Block 2)
    • Anomaly score = 1 - (cluster_size / fleet_size) (Block 3)
  • Keep MQTT topics the same — only swap fog_node.py internals.

Files

  • docker-compose.yml
  • mosquitto/mosquitto.conf
  • edge/Dockerfile, edge_node.py
  • fog/Dockerfile, fog_node.py
  • cloud/Dockerfile, cloud_app.py

Contributors

About

Docker-based simulation of edge nodes running unsupervised anomaly detection for industrial fleet environments.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published