How adityaph-17/electricity_consumption_anomaly_detection_system works
WattWatch is a Flask web application for analyzing uploaded electricity-consumption CSVs. A browser submits a file and detector settings; Flask orchestrates column mapping, cleaning, baseline statistics, three detection methods, consensus voting, optional label-based evaluation, and CSV export, then returns analysis for dashboard visualization. The README also documents a sample-CSV download route. The pipeline and UI links are supported by the shown Flask and JavaScript excerpts; dashboard visualization details are partly documented in the README.
Main entry points: app.py Flask API · script.js Upload and dashboard · step8_export.py CSV export · index.html Dashboard page
Components 13
Web interface
- Upload and dashboard
static/script.js - Dashboard page
templates/index.html
Pipeline orchestration
- Flask API
app.py
Consumption analysis
- CSV mapping
step1_upload.py - Data cleaning
step2_preprocess.py - Baseline statistics
step3_statistics.py - Anomaly detectors
step4_detection.py - Consensus voting
step5_compare.py
Results and reporting
- Label evaluation
step7_evaluate.py - CSV export
step8_export.py - Exported results
- Sample CSV download
Other components
- Browser user
Connections 15
- Browser user → Upload and dashboard: uses
README.md - Upload and dashboard → Flask API: posts analysis
static/script.js - Flask API → Dashboard page: renders
app.py - Flask API → CSV mapping: loads CSV
app.py - Flask API → Data cleaning: cleans records
app.py - Flask API → Baseline statistics: calculates baseline
app.py - Flask API → Anomaly detectors: detects anomalies
app.py - Flask API → Consensus voting: compares methods
app.py - Flask API → Label evaluation: evaluates labels
app.py - Flask API → CSV export: exports results
app.py - CSV export → Exported results: writes CSV
step8_export.py - Upload and dashboard → Flask API: requests download
- Flask API → Exported results: serves download
app.py - Flask API → Sample CSV download: serves sample
app.py - Flask API → Upload and dashboard: returns analysis
app.py