# iamhharish/polyatomic-nodules-detection architecture

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

- Interactive diagram: https://gitdiagram.com/iamhharish/polyatomic-nodules-detection
- Repository: https://github.com/iamhharish/polyatomic-nodules-detection

## Overview

This repository is a seabed-nodule image-processing and detection prototype. Its image workflow preprocesses raw images, then provides separate unsupervised and supervised training scripts; detection independently applies classical edge-and-contour processing to a processed image. The sampled detection code does not load either trained model, so the graph does not imply a model-to-detection connection. Training inputs and outputs are inferred from directory and filename references in the scripts; no wiring for the YOLO files is established by the sampled source.

Main entry points: [`preprocess_images.py`](https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/preprocess_images.py) (Image preprocessing), [`train_unsupervised_dbn.py`](https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/train_unsupervised_dbn.py) (Unsupervised DBN), [`train_supervised_dbn.py`](https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/train_supervised_dbn.py) (Supervised classifier), [`detect_objects.py`](https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/detect_objects.py) (Contour detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Image preparation"]
  node_preprocess["Image preprocessing"]
  node_processed_images[("Processed images")]
end

subgraph group_training["Model training"]
  node_unsup_training["Unsupervised DBN"]
  node_unsup_features[("DBN feature weights")]
  node_sup_training["Supervised classifier"]
  node_classifier_weights[("Classifier weights")]
end

subgraph group_detection["Image detection"]
  node_detection["Contour detection<br/>[detect_objects.py]"]
  node_detections[("Annotated image")]
end

node_raw_images[("Raw images")]
node_labeled_images[("Training images")]

node_raw_images -->|"reads"| node_preprocess
node_preprocess -->|"writes"| node_processed_images
node_processed_images -->|"reads"| node_unsup_training
node_unsup_training -->|"saves weights"| node_unsup_features
node_labeled_images -->|"reads"| node_sup_training
node_sup_training -->|"saves weights"| node_classifier_weights
node_processed_images -->|"reads"| node_detection
node_detection -->|"writes"| node_detections

click node_preprocess "https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/preprocess_images.py"
click node_unsup_training "https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/train_unsupervised_dbn.py"
click node_sup_training "https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/train_supervised_dbn.py"
click node_detection "https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/detect_objects.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_preprocess,node_processed_images toneBlue
class node_unsup_training,node_unsup_features,node_sup_training,node_classifier_weights,node_raw_images,node_labeled_images toneAmber
class node_detection,node_detections toneMint
```

## Components

### Image preparation

- [Image preprocessing](https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/preprocess_images.py): `preprocess_images.py`
- **Processed images**

### Model training

- [Unsupervised DBN](https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/train_unsupervised_dbn.py): `train_unsupervised_dbn.py`
- **DBN feature weights**
- [Supervised classifier](https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/train_supervised_dbn.py): `train_supervised_dbn.py`
- **Classifier weights**

### Image detection

- [Contour detection](https://github.com/iamhharish/polyatomic-nodules-detection/blob/main/detect_objects.py): `detect_objects.py`
- **Annotated image**

### Other components

- **Raw images**
- **Training images**

## Connections

- Raw images → Image preprocessing: reads
- Image preprocessing → Processed images: writes
- Processed images → Unsupervised DBN: reads
- Unsupervised DBN → DBN feature weights: saves weights
- Training images → Supervised classifier: reads
- Supervised classifier → Classifier weights: saves weights
- Processed images → Contour detection: reads
- Contour detection → Annotated image: writes
