# abdul-81-basha/oceanmind-ai architecture

> Architecture diagram of the GitHub repository abdul-81-basha/oceanmind-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abdul-81-basha/oceanmind-ai
- Repository: https://github.com/abdul-81-basha/oceanmind-ai

## Overview

OceanMind is a marine-pollution segmentation platform: users upload an 11-band optical GeoTIFF, the API runs a 15-class U-Net prediction, and the frontend presents maps, class breakdowns, and exportable results. The repository also contains the model’s dataset, training, and evaluation workflow. The frontend and backend contract is documented and excerpted; training and evaluation relationships are supported by their source-index references. The frontend excerpt is partial, so its internal UI implementation is represented as one component.

Main entry points: [`backend/main.py`](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/backend/main.py) (Prediction API), [`train_model.py`](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/train_model.py) (Model Training), [`evaluate_model.py`](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/evaluate_model.py) (Model Evaluation), [`app/page.tsx`](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/app/page.tsx) (Analysis Console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_console["Analysis Console<br/>[page.tsx]"]
end

subgraph group_inference["Inference Service"]
  node_api["Prediction API<br/>[main.py]"]
  node_unet["U-Net Model<br/>[unet_model.py]"]
  node_result_assets["Prediction Assets<br/>[main.py]"]
end

subgraph group_ml["Model Development"]
  node_checkpoint["Model Checkpoint"]
  node_dataset["MARIDA Dataset Loader<br/>[dataset_loader.py]"]
  node_training["Model Training<br/>[train_model.py]"]
  node_evaluation["Model Evaluation<br/>[evaluate_model.py]"]
end

node_user(("Analyst"))

node_user -->|"uploads imagery"| node_console
node_console -->|"posts image"| node_api
node_api -->|"runs inference"| node_unet
node_api -->|"writes maps"| node_result_assets
node_console -->|"loads result images"| node_result_assets
node_training -->|"loads samples"| node_dataset
node_training -->|"trains model"| node_unet
node_training -->|"saves weights"| node_checkpoint
node_evaluation -->|"loads test data"| node_dataset
node_evaluation -->|"evaluates model"| node_unet
node_evaluation -->|"loads weights"| node_checkpoint
node_api -->|"loads weights"| node_checkpoint

click node_console "https://github.com/abdul-81-basha/oceanmind-ai/blob/main/app/page.tsx"
click node_api "https://github.com/abdul-81-basha/oceanmind-ai/blob/main/backend/main.py"
click node_unet "https://github.com/abdul-81-basha/oceanmind-ai/blob/main/unet_model.py"
click node_result_assets "https://github.com/abdul-81-basha/oceanmind-ai/blob/main/backend/main.py"
click node_checkpoint "https://github.com/abdul-81-basha/oceanmind-ai/blob/main/outputs/marine_debris_segmentation.pth"
click node_dataset "https://github.com/abdul-81-basha/oceanmind-ai/blob/main/dataset_loader.py"
click node_training "https://github.com/abdul-81-basha/oceanmind-ai/blob/main/train_model.py"
click node_evaluation "https://github.com/abdul-81-basha/oceanmind-ai/blob/main/evaluate_model.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_console toneBlue
class node_api,node_unet,node_result_assets toneAmber
class node_checkpoint,node_dataset,node_training,node_evaluation toneMint
class node_user toneIndigo
```

## Components

### User Experience

- [Analysis Console](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/app/page.tsx): `app/page.tsx`

### Inference Service

- [Prediction API](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/backend/main.py): `backend/main.py`
- [U-Net Model](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/unet_model.py): `unet_model.py`
- [Prediction Assets](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/backend/main.py): `backend/main.py`

### Model Development

- [Model Checkpoint](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/outputs/marine_debris_segmentation.pth): `outputs/marine_debris_segmentation.pth`
- [MARIDA Dataset Loader](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/dataset_loader.py): `dataset_loader.py`
- [Model Training](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/train_model.py): `train_model.py`
- [Model Evaluation](https://github.com/abdul-81-basha/oceanmind-ai/blob/main/evaluate_model.py): `evaluate_model.py`

### Other components

- **Analyst**

## Connections

- Analyst → Analysis Console: uploads imagery (evidence: `README.md`)
- Analysis Console → Prediction API: posts image (evidence: `app/page.tsx`)
- Prediction API → U-Net Model: runs inference (evidence: `backend/main.py`)
- Prediction API → Prediction Assets: writes maps (evidence: `backend/main.py`)
- Analysis Console → Prediction Assets: loads result images (evidence: `README.md`)
- Model Training → MARIDA Dataset Loader: loads samples (evidence: `train_model.py`)
- Model Training → U-Net Model: trains model (evidence: `train_model.py`)
- Model Training → Model Checkpoint: saves weights (evidence: `train_model.py`)
- Model Evaluation → MARIDA Dataset Loader: loads test data (evidence: `evaluate_model.py`)
- Model Evaluation → U-Net Model: evaluates model (evidence: `evaluate_model.py`)
- Model Evaluation → Model Checkpoint: loads weights (evidence: `evaluate_model.py`)
- Prediction API → Model Checkpoint: loads weights (evidence: `backend/main.py`)
