# sohaib50k/thirdeye---iris-recognition-using-triplets architecture

> Architecture diagram of the GitHub repository sohaib50k/thirdeye---iris-recognition-using-triplets, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sohaib50k/thirdeye---iris-recognition-using-triplets
- Repository: https://github.com/sohaib50k/thirdeye---iris-recognition-using-triplets

## Overview

##### Project type and purpose
- From the file tree (Attention.py, EER.py, helperFunc.py, bh_iris.ipynb) and the README, this is a research‐oriented machine learning pipeline for iris recognition.
- It is not a web or full-stack app but an experimental framework that:
- Ingests pre-segmented iris images (from Mask R-CNN)
- Trains a Keras/TensorFlow model using triplet‐loss variants (with optional attention)
- Evaluates performance (EER, distance histograms, FAR/FRR)
- Produces visualizations in scripts/notebooks

##### File structure
- Top-level scripts:
- Attention.py – defines/attaches attention modules to the embedding network
- EER.py – computes Equal Error Rate and generates FAR/FRR plots
- helperFunc.py – utility routines (data reading, preprocessing, distance computation)
- bh_iris.ipynb – interactive notebook demonstrating training/testing workflows and plotting
- No “frontend/backend” split; everything is in Python/Notebook form.
- There is an implicit dependency on an external segmentation pipeline (Mask-R CNN) to generate square black-background iris crops.

##### README for architecture hints
- The data folder structure:
/train/<class>/<image>.png
/test/*.png
- A custom Keras generator yields triplets (anchor, positive, negative).
- Outputs include distance histograms and correlation matrices.
- References to core libraries: Keras, TensorFlow, NumPy, OpenCV, Matplotlib.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "External Services"
        Segmentation["Mask-R CNN Service"]:::external
    end

    subgraph "Data Storage"
        FS["Filesystem: train/testing folders"]:::data
        Checkpoints["Model Checkpoints"]:::data
    end

    subgraph "Data Pipeline"
        Prep["Data Preparation Module"]:::compute
        Generator["Triplet DataGenerator"]:::compute
    end

    subgraph "Model"
        Embedding["Embedding Network + Attention"]:::compute
        Training["Training Pipeline (compile & fit)"]:::compute
    end

    subgraph "Evaluation & Visualization"
        Eval["Evaluation Module"]:::eval
        Visual["Visualization Layer"]:::eval
        Notebook["Interactive Training & Visualization Notebook"]:::eval
    end

    Doc["README.md"]:::doc

    Segmentation --> Prep
    FS --> Prep
    Prep --> Generator
    Generator --> Embedding
    Embedding --> Training
    Training --> Checkpoints
    Checkpoints --> Eval
    FS --> Eval
    Eval --> Visual
    Visual --> Notebook

    click Prep "https://github.com/sohaib50k/thirdeye---iris-recognition-using-triplets/blob/master/helperFunc.py"
    click Embedding "https://github.com/sohaib50k/thirdeye---iris-recognition-using-triplets/blob/master/Attention.py"
    click Eval "https://github.com/sohaib50k/thirdeye---iris-recognition-using-triplets/blob/master/EER.py"
    click Notebook "https://github.com/sohaib50k/thirdeye---iris-recognition-using-triplets/blob/master/bh_iris.ipynb"
    click Doc "https://github.com/sohaib50k/thirdeye---iris-recognition-using-triplets/blob/master/README.md"

    classDef data fill:#9f6,stroke:#333,stroke-width:1px
    classDef compute fill:#6cf,stroke:#333,stroke-width:1px
    classDef external fill:#f96,stroke:#333,stroke-width:1px,stroke-dasharray:5 5
    classDef eval fill:#c6c,stroke:#333,stroke-width:1px
    classDef doc fill:#ccc,stroke:#333,stroke-width:1px,stroke-dasharray:2 2
```
