# sanjayshettigar/anomaly_detection_in_solarpowerproduction architecture

> Architecture diagram of the GitHub repository sanjayshettigar/anomaly_detection_in_solarpowerproduction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction
- Repository: https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction

## Overview

This repository provides solar-production anomaly detection, with both a fixed-dataset dashboard and a CSV-upload web application. The principal workflow is to load solar time-series data, preprocess and engineer temporal features, train anomaly models, combine predictions, evaluate them, and present metrics and plots. The README documents FFNN, LSTM, LSTM Autoencoder, Isolation Forest, and an XGBoost meta-ensemble; the sampled implementation excerpts do not expose every model’s wiring, so those internal links are represented only at the documented pipeline level. The graph also shows the upload app as a separate entry point; unsampled UI and route details are omitted.

Main entry points: [`backend/anomaly_detector.py`](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py) (Anomaly models), [`backend/app.py`](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/app.py) (Fixed-data API), [`backend/web_app_upload.py`](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/web_app_upload.py) (Upload API), [`frontend/index.html`](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/frontend/index.html) (Dashboard page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interfaces"]
  node_frontend["Dashboard page<br/>[index.html]"]
  node_fixed_api["Fixed-data API<br/>[app.py]"]
  node_fixed_templates["Upload page templates"]
  node_upload_api["Upload API<br/>[web_app_upload.py]"]
end

subgraph group_analysis["Detection workflow"]
  node_load["Load data"]
  node_prepare["Preprocess features"]
  node_models["Anomaly models"]
  node_ffnn["FFNN"]
  node_lstm["LSTM"]
  node_autoencoder["LSTM Autoencoder"]
  node_isolation["Isolation Forest"]
  node_ensemble["XGBoost ensemble"]
  node_upload_results["Upload analysis<br/>[web_app_upload.py]"]
end

subgraph group_evaluation["Evaluation and plots"]
  node_evaluation["Metrics evaluation"]
  node_plots["Visualizations"]
  node_plot_store["Generated plots"]
end

subgraph group_data["Input data"]
  node_fixed_data["Solar dataset<br/>[wind_solar.csv]"]
  node_uploaded_data["Uploaded datasets"]
end

node_user(("Dashboard user"))
node_csv_user(("CSV uploader"))

node_user -->|"opens"| node_frontend
node_frontend -->|"requests"| node_fixed_api
node_fixed_api -->|"runs analysis"| node_load
node_fixed_api -->|"requests metrics"| node_evaluation
node_fixed_api -->|"requests plots"| node_plots
node_load -->|"reads"| node_fixed_data
node_load -->|"prepares data"| node_prepare
node_prepare -->|"provides features"| node_models
node_models -->|"trains"| node_ffnn
node_models -->|"trains"| node_lstm
node_models -.->|"trains"| node_autoencoder
node_models -.->|"trains"| node_isolation
node_models -->|"combines predictions"| node_ensemble
node_models -->|"provides predictions"| node_evaluation
node_evaluation -->|"summarizes results"| node_plots
node_plots -->|"writes"| node_plot_store
node_fixed_api -->|"serves"| node_plot_store
node_csv_user -->|"uploads CSV"| node_upload_api
node_upload_api -->|"renders"| node_fixed_templates
node_upload_api -->|"stores upload"| node_uploaded_data
node_upload_api -->|"preprocesses and trains"| node_upload_results
node_upload_results -->|"evaluates predictions"| node_evaluation

click node_frontend "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/frontend/index.html"
click node_fixed_api "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/app.py"
click node_fixed_templates "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/tree/main/backend/templates"
click node_upload_api "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/web_app_upload.py"
click node_fixed_data "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/data/wind_solar.csv"
click node_uploaded_data "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/tree/main/backend/uploads"
click node_load "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_prepare "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_models "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_ffnn "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_lstm "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_autoencoder "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_isolation "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_ensemble "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_evaluation "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_plots "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py"
click node_plot_store "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/tree/main/backend/plots"
click node_upload_results "https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/web_app_upload.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend,node_fixed_api,node_fixed_templates,node_upload_api,node_user toneBlue
class node_load,node_prepare,node_models,node_ffnn,node_lstm,node_autoencoder,node_isolation,node_ensemble,node_upload_results toneAmber
class node_evaluation,node_plots,node_plot_store toneMint
class node_fixed_data,node_uploaded_data toneRose
class node_csv_user toneIndigo
```

## Components

### Web interfaces

- [Dashboard page](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/frontend/index.html): `frontend/index.html`
- [Fixed-data API](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/app.py): `backend/app.py`
- [Upload page templates](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/tree/main/backend/templates): `backend/templates`
- [Upload API](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/web_app_upload.py): `backend/web_app_upload.py`

### Detection workflow

- [Load data](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [Preprocess features](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [Anomaly models](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [FFNN](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [LSTM](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [LSTM Autoencoder](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [Isolation Forest](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [XGBoost ensemble](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [Upload analysis](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/web_app_upload.py): `backend/web_app_upload.py`

### Evaluation and plots

- [Metrics evaluation](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [Visualizations](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/backend/anomaly_detector.py): `backend/anomaly_detector.py`
- [Generated plots](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/tree/main/backend/plots): `backend/plots`

### Input data

- [Solar dataset](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/blob/main/data/wind_solar.csv): `data/wind_solar.csv`
- [Uploaded datasets](https://github.com/sanjayshettigar/anomaly_detection_in_solarpowerproduction/tree/main/backend/uploads): `backend/uploads`

### Other components

- **Dashboard user**
- **CSV uploader**

## Connections

- Dashboard user → Dashboard page: opens
- Dashboard page → Fixed-data API: requests
- Fixed-data API → Load data: runs analysis
- Fixed-data API → Metrics evaluation: requests metrics
- Fixed-data API → Visualizations: requests plots
- Load data → Solar dataset: reads
- Load data → Preprocess features: prepares data
- Preprocess features → Anomaly models: provides features
- Anomaly models → FFNN: trains
- Anomaly models → LSTM: trains
- Anomaly models → LSTM Autoencoder: trains
- Anomaly models → Isolation Forest: trains
- Anomaly models → XGBoost ensemble: combines predictions
- Anomaly models → Metrics evaluation: provides predictions
- Metrics evaluation → Visualizations: summarizes results
- Visualizations → Generated plots: writes
- Fixed-data API → Generated plots: serves
- CSV uploader → Upload API: uploads CSV
- Upload API → Upload page templates: renders
- Upload API → Uploaded datasets: stores upload
- Upload API → Upload analysis: preprocesses and trains
- Upload analysis → Metrics evaluation: evaluates predictions
