# aaman-17/sih architecture

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

- Interactive diagram: https://gitdiagram.com/aaman-17/sih
- Repository: https://github.com/aaman-17/sih

## Overview

AI-Powered Marine Debris & Anomaly Detection is a Streamlit application for reviewing side-scan sonar and, separately, ordinary underwater photos. The main workflow takes uploaded sonar through XTF/image ingestion, preprocessing, detection and anomaly scoring, then geotags detections and exports JSON/CSV reports in the dashboard. A separate optical triage path combines generic object proposals with a plastic-film heuristic. The README documents shipwreck detection and reporting capabilities; source excerpts are partial, so some internal wiring is not shown.

Main entry points: [`app.py`](https://github.com/aaman-17/sih/blob/main/app.py) (Streamlit dashboard), [`src/detection_pipeline.py`](https://github.com/aaman-17/sih/blob/main/src/detection_pipeline.py) (Detection and fusion), [`src/geotagging.py`](https://github.com/aaman-17/sih/blob/main/src/geotagging.py) (Geotagging engine), [`src/aura_theme.py`](https://github.com/aaman-17/sih/blob/main/src/aura_theme.py) (HUD styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_app["Streamlit dashboard<br/>[app.py]"]
  node_theme["HUD styling<br/>[aura_theme.py]"]
end

subgraph group_sonar["Sonar Processing"]
  node_xtf["XTF ingestion<br/>[xtf_loader.py]"]
  node_guard["Sonar input guard<br/>[sonar_guard.py]"]
  node_preprocess["Sonar preprocessing<br/>[preprocessing.py]"]
end

subgraph group_detection["Detection"]
  node_pipeline["Detection and fusion"]
  node_yolo["Sonar YOLO models"]
  node_autoencoder["Anomaly scorer<br/>[autoencoder.py]"]
  node_quality["Detection quality"]
  node_shipwreck["Shipwreck checkpoint"]
end

subgraph group_reporting["Geospatial Reporting"]
  node_geotag["Geotagging engine<br/>[geotagging.py]"]
  node_reports["JSON/CSV reports<br/>[geotagging.py]"]
end

subgraph group_optical["Optical Triage"]
  node_optical["Optical triage"]
end

node_operator(("Survey operator"))

node_operator -->|"uploads input"| node_app
node_app -->|"injects styling"| node_theme
node_app -->|"loads sonar"| node_xtf
node_app -->|"checks sonar"| node_guard
node_app -.->|"runs photo triage"| node_optical
node_app -->|"preprocesses sonar"| node_preprocess
node_app -->|"runs detection"| node_pipeline
node_pipeline -->|"detects objects"| node_yolo
node_pipeline -->|"detects shipwrecks"| node_shipwreck
node_pipeline -->|"scores anomalies"| node_autoencoder
node_app -->|"uses quality metrics"| node_quality
node_app -->|"geotags detections"| node_geotag
node_geotag -->|"writes reports"| node_reports
node_app -->|"exports reports"| node_reports

click node_app "https://github.com/aaman-17/sih/blob/main/app.py"
click node_theme "https://github.com/aaman-17/sih/blob/main/src/aura_theme.py"
click node_xtf "https://github.com/aaman-17/sih/blob/main/src/xtf_loader.py"
click node_guard "https://github.com/aaman-17/sih/blob/main/src/sonar_guard.py"
click node_preprocess "https://github.com/aaman-17/sih/blob/main/src/preprocessing.py"
click node_pipeline "https://github.com/aaman-17/sih/blob/main/src/detection_pipeline.py"
click node_yolo "https://github.com/aaman-17/sih/tree/main/models"
click node_autoencoder "https://github.com/aaman-17/sih/blob/main/src/autoencoder.py"
click node_quality "https://github.com/aaman-17/sih/blob/main/src/detection_quality.py"
click node_shipwreck "https://github.com/aaman-17/sih/blob/main/models/yolo_shipwreck_ai4shipwrecks.pt"
click node_geotag "https://github.com/aaman-17/sih/blob/main/src/geotagging.py"
click node_reports "https://github.com/aaman-17/sih/blob/main/src/geotagging.py"
click node_optical "https://github.com/aaman-17/sih/blob/main/src/optical_detector.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_app,node_theme toneBlue
class node_xtf,node_guard,node_preprocess toneAmber
class node_pipeline,node_yolo,node_autoencoder,node_quality,node_shipwreck toneMint
class node_geotag,node_reports toneRose
class node_optical,node_operator toneIndigo
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/aaman-17/sih/blob/main/app.py): `app.py`
- [HUD styling](https://github.com/aaman-17/sih/blob/main/src/aura_theme.py): `src/aura_theme.py`

### Sonar Processing

- [XTF ingestion](https://github.com/aaman-17/sih/blob/main/src/xtf_loader.py): `src/xtf_loader.py`
- [Sonar input guard](https://github.com/aaman-17/sih/blob/main/src/sonar_guard.py): `src/sonar_guard.py`
- [Sonar preprocessing](https://github.com/aaman-17/sih/blob/main/src/preprocessing.py): `src/preprocessing.py`

### Detection

- [Detection and fusion](https://github.com/aaman-17/sih/blob/main/src/detection_pipeline.py): `src/detection_pipeline.py`
- [Sonar YOLO models](https://github.com/aaman-17/sih/tree/main/models): `models`
- [Anomaly scorer](https://github.com/aaman-17/sih/blob/main/src/autoencoder.py): `src/autoencoder.py`
- [Detection quality](https://github.com/aaman-17/sih/blob/main/src/detection_quality.py): `src/detection_quality.py`
- [Shipwreck checkpoint](https://github.com/aaman-17/sih/blob/main/models/yolo_shipwreck_ai4shipwrecks.pt): `models/yolo_shipwreck_ai4shipwrecks.pt`

### Geospatial Reporting

- [Geotagging engine](https://github.com/aaman-17/sih/blob/main/src/geotagging.py): `src/geotagging.py`
- [JSON/CSV reports](https://github.com/aaman-17/sih/blob/main/src/geotagging.py): `src/geotagging.py`

### Optical Triage

- [Optical triage](https://github.com/aaman-17/sih/blob/main/src/optical_detector.py): `src/optical_detector.py`

### Other components

- **Survey operator**

## Connections

- Survey operator → Streamlit dashboard: uploads input
- Streamlit dashboard → HUD styling: injects styling
- Streamlit dashboard → XTF ingestion: loads sonar
- Streamlit dashboard → Sonar input guard: checks sonar
- Streamlit dashboard → Optical triage: runs photo triage
- Streamlit dashboard → Sonar preprocessing: preprocesses sonar
- Streamlit dashboard → Detection and fusion: runs detection
- Detection and fusion → Sonar YOLO models: detects objects
- Detection and fusion → Shipwreck checkpoint: detects shipwrecks
- Detection and fusion → Anomaly scorer: scores anomalies
- Streamlit dashboard → Detection quality: uses quality metrics
- Streamlit dashboard → Geotagging engine: geotags detections
- Geotagging engine → JSON/CSV reports: writes reports
- Streamlit dashboard → JSON/CSV reports: exports reports
