# uzayr0011/image-classification architecture

> Architecture diagram of the GitHub repository uzayr0011/image-classification, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/uzayr0011/image-classification
- Repository: https://github.com/uzayr0011/image-classification

## Overview

##### Project type and purpose
- This is a data-science / machine-learning pipeline (not a web app or microservice) built in Jupyter notebooks.
- Purpose: train and evaluate a CNN (VGG16 transfer learning) to classify six animal species from images.

##### File structure
- Top-level code units:
– `*.ipynb` notebooks (exploration, experiments, final)
– `experiments/` directory with variant notebooks
– `Animal Image Classifier.pptx` (presentation)
- Data directories:
– `data/train/`, `data/validation/`, `data/test/` with subfolders per class
- Model artifact: `bottleneck_fc_model.h5`
- Configuration isn’t heavy—no Docker, no microservices, purely notebook scripts.

##### README for additional insights
- Confirms transfer-learning (VGG16) approach in Keras/TensorFlow
- Dataset from Kaggle’s Animals-10 (six classes)
- Final Notebook links to full workflow and metrics

1. Data Storage
– Raw images (Kaggle download) organized into train/validation/test
2. Data Preparation Module
– Jupyter cells or Python scripts that resize, normalize, and batch images
3. Model Training & Experimentation
– `I_notebook.ipynb`, `V_notebook.ipynb`, `experiments/*.ipynb`:
- VGG16 base, add custom FC head
- Train on `data/train`, validate on `data/validation`
4. Evaluation & Validation
– Compute accuracy, precision, confusion matrix
5. Model Artifact Storage
– `bottleneck_fc_model.h5` (best checkpoint)
6. Inference / Testing
– `test_file.ipynb` or custom script for arbitrary image prediction
7. Presentation Layer
– `Animal Image Classifier.pptx` and README visuals

- Data Storage → Data Preparation
- Data Preparation → Model Training & Experimentation
- Training → Model Artifact Storage
- Training → Evaluation & Validation
- Model Artifact Storage → Inference / Testing
- Inference / Testing → Presentation Layer (demo outputs)

c. Architectural patterns & principles
- Modular notebook-based pipeline: separation of data prep, training, evaluation
- Transfer-learning design: reuse of pre-trained VGG16 (external dependency)
- Iterative experimentation: multiple notebook variants in `experiments/`

d. Key technologies/frameworks
- Python 3.x, Jupyter Notebook
- Keras (TensorFlow backend)
- VGG16 pre-trained model from Keras.applications
- NumPy, Pandas, Matplotlib/Seaborn for visualization
- Kaggle dataset (external data source)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        DataStorage["Data Storage\n(data/train/, data/validation/, data/test/)"]:::data
    end

    %% Data Preparation
    subgraph "Data Preparation"
        DataPrep["Data Preparation Notebook\nI_notebook.ipynb"]:::code
    end

    %% Model Training & Experimentation
    subgraph "Model Training & Experimentation"
        V1["V_notebook.ipynb"]:::code
        V2["V2_pretrained.ipynb"]:::code
        V3["V_notebook-Copy1.ipynb"]:::code
        FinalNotebook["final_notebook.ipynb"]:::code
    end

    %% Evaluation & Validation
    subgraph "Evaluation & Validation"
        Eval1["final_notebook.ipynb"]:::code
        TestNotebook["test_file.ipynb"]:::code
        Images["images/ (visualization assets)"]:::data
    end

    %% Model Artifact Storage
    subgraph "Model Artifact Storage"
        Artifact["bottleneck_fc_model.h5"]:::artifact
    end

    %% Inference / Testing
    subgraph "Inference / Testing"
        Inference["test_file.ipynb"]:::code
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        PPT["Animal Image Classifier.pptx"]:::presentation
        Readme["README.md"]:::presentation
        OutImages["images/ (outputs)"]:::presentation
    end

    %% External Dependencies
    Kaggle["Kaggle Dataset"]:::external
    TF["VGG16 from Keras.applications"]:::external

    %% Data Flow
    Kaggle -.-> DataStorage
    DataStorage --> DataPrep
    DataPrep --> V1
    DataPrep --> V2
    DataPrep --> V3
    DataPrep --> FinalNotebook
    TF -.-> V1
    TF -.-> V2
    TF -.-> V3
    TF -.-> FinalNotebook
    FinalNotebook --> Artifact
    FinalNotebook --> Eval1
    Eval1 --> Images
    Eval1 --> TestNotebook
    Artifact --> Inference
    Inference --> PPT
    Inference --> Readme
    Inference --> OutImages

    %% Click Events
    click DataStorage "https://github.com/uzayr0011/image-classification/tree/master/data/train/"
    click DataPrep "https://github.com/uzayr0011/image-classification/blob/master/I_notebook.ipynb"
    click V1 "https://github.com/uzayr0011/image-classification/blob/master/V_notebook.ipynb"
    click V2 "https://github.com/uzayr0011/image-classification/blob/master/experiments/V2_pretrained.ipynb"
    click V3 "https://github.com/uzayr0011/image-classification/blob/master/experiments/V_notebook-Copy1.ipynb"
    click FinalNotebook "https://github.com/uzayr0011/image-classification/blob/master/final_notebook.ipynb"
    click Eval1 "https://github.com/uzayr0011/image-classification/blob/master/final_notebook.ipynb"
    click TestNotebook "https://github.com/uzayr0011/image-classification/blob/master/test_file.ipynb"
    click Images "https://github.com/uzayr0011/image-classification/tree/master/images/"
    click Artifact "https://github.com/uzayr0011/image-classification/blob/master/bottleneck_fc_model.h5"
    click Inference "https://github.com/uzayr0011/image-classification/blob/master/test_file.ipynb"
    click PPT "https://github.com/uzayr0011/image-classification/blob/master/Animal Image Classifier.pptx"
    click Readme "https://github.com/uzayr0011/image-classification/blob/master/README.md"
    click OutImages "https://github.com/uzayr0011/image-classification/tree/master/images/"

    %% Styles
    classDef data fill:#cce5ff,stroke:#4d94ff
    classDef code fill:#d4edda,stroke:#28a745
    classDef artifact fill:#fff3cd,stroke:#ffc107
    classDef presentation fill:#e2d5f7,stroke:#6f42c1
    classDef external fill:#f0f0f0,stroke:#6c757d,stroke-dasharray: 4 2
```
