# omals/microplastic-detection-and-segmentation architecture

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

- Interactive diagram: https://gitdiagram.com/omals/microplastic-detection-and-segmentation
- Repository: https://github.com/omals/microplastic-detection-and-segmentation

## Overview

This repository is a notebook-based research prototype for detecting and segmenting microplastics in microscopy images. Its documented workflow covers image preprocessing and augmentation, U-Net binary segmentation, model training with Dice Loss or BCE, and evaluation with IoU and Dice Score. The README describes these capabilities but provides no source excerpts, so internal call order and data handoffs cannot be verified; inferred workflow links are marked dashed.

Main entry points: [`ResNet50 and UNet.ipynb`](https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb) (U-Net)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Image preparation"]
  node_preprocessing["Preprocessing"]
  node_augmentation["Data augmentation"]
end

subgraph group_model["Segmentation model"]
  node_unet["U-Net"]
  node_segmentation["Binary segmentation"]
end

subgraph group_evaluation["Training and evaluation"]
  node_training["Model training"]
  node_loss["Dice Loss / BCE"]
  node_metrics["IoU / Dice Score"]
end

node_microscopy_images["Microscopy images"]

node_microscopy_images -->|"preprocesses"| node_preprocessing
node_preprocessing -.->|"then augments"| node_augmentation
node_augmentation -.->|"then trains"| node_training
node_training -.->|"trains"| node_unet
node_training -->|"uses"| node_loss
node_unet -->|"segments"| node_segmentation
node_unet -.->|"evaluated with"| node_metrics

click node_preprocessing "https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb"
click node_augmentation "https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb"
click node_unet "https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb"
click node_training "https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb"
click node_loss "https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb"
click node_metrics "https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb"
click node_segmentation "https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb"

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_preprocessing,node_augmentation toneBlue
class node_unet,node_segmentation toneAmber
class node_training,node_loss,node_metrics toneMint
class node_microscopy_images toneIndigo
```

## Components

### Image preparation

- [Preprocessing](https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb): `ResNet50 and UNet.ipynb`
- [Data augmentation](https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb): `ResNet50 and UNet.ipynb`

### Segmentation model

- [U-Net](https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb): `ResNet50 and UNet.ipynb`
- [Binary segmentation](https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb): `ResNet50 and UNet.ipynb`

### Training and evaluation

- [Model training](https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb): `ResNet50 and UNet.ipynb`
- [Dice Loss / BCE](https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb): `ResNet50 and UNet.ipynb`
- [IoU / Dice Score](https://github.com/omals/microplastic-detection-and-segmentation/blob/main/ResNet50%20and%20UNet.ipynb): `ResNet50 and UNet.ipynb`

### Other components

- **Microscopy images**

## Connections

- Microscopy images → Preprocessing: preprocesses (evidence: `README.md`)
- Preprocessing → Data augmentation: then augments
- Data augmentation → Model training: then trains
- Model training → U-Net: trains
- Model training → Dice Loss / BCE: uses (evidence: `README.md`)
- U-Net → Binary segmentation: segments (evidence: `README.md`)
- U-Net → IoU / Dice Score: evaluated with
