# prajnaagrawal26/image-retrieval_prml architecture

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

- Interactive diagram: https://gitdiagram.com/prajnaagrawal26/image-retrieval_prml
- Repository: https://github.com/prajnaagrawal26/image-retrieval_prml

## Overview

##### Project Type and Purpose
- Project Type: Machine learning/image retrieval system.
- Purpose: To perform image retrieval using various pattern recognition and machine learning (PRML) approaches such as CNNs, ResNet, Logistic Regression (LR), Random Forest, and combinations thereof. The project uses experiments (Jupyter notebooks) to compare different methods and maintain pre-trained model checkpoints.

##### File Structure
- Top-level directories and files:
- Checkpoints: Contains serialized/trained model files (e.g., LR.pkl, RF.pkl, kmeans+lda+cnn.pkl, resnet32.ckpt). These represent the saved states of trained models.
- Experiments: A collection of Jupyter notebooks naming combinations like CNN+SVM, HoG+SVM, Decision Trees, and so on. These notebooks likely show experimentation with various feature extraction methods (e.g., HoG, PCA, LDA) and classifiers.
- Model: Contains core implementation code such as Aether.py, LR+LDA+ResNet.py, Random_Forest_Model.py, and a ResNet model implementation. This directory holds the reusable code that defines different models and possibly wraps inference/training logic.
- app.py: Likely the entry-point for the application. This could act as an API or command-line interface to run the image retrieval functions.
- requirements.txt: Lists external dependencies.
- Implicit Architectural Choices:
- Separation between experimental research (experiments notebooks) and production-level code (Model and app.py).
- Persistence of trained models in the Checkpoints directory.
- Use of modular design by splitting model definitions into separate files for different approaches.

##### README for Additional Insights
- Although minimal, the README (“Image-Retrieval_PRML”) confirms the project’s focus on image retrieval using PRML techniques.

## Diagram (Mermaid)

```mermaid
graph TD
    dep["Dependencies & Libraries (requirements.txt)"]:::dependencies
    ui["User Interface (app.py)"]:::ui
    exp["Experiments (Jupyter Notebooks)"]:::experiments

    subgraph "ML Processing Engine"
        subgraph "Model Definitions"
            aether["Aether"]:::model
            lrlr["LR+LDA+ResNet"]:::model
            rfm["Random_Forest_Model"]:::model
            resnet["resnet_model"]:::model
        end
        subgraph "Model Artifacts"
            lr["LR.pkl"]:::artifacts
            rf["RF.pkl"]:::artifacts
            kmeans["kmeans+lda+cnn.pkl"]:::artifacts
            resnetck["resnet32.ckpt"]:::artifacts
        end
    end

    %% Arrows for data flow
    ui -->|"routesInput"| aether
    exp -->|"trainsModels"| lr
    lr -->|"loadedBy"| aether
    dep --> ui
    dep --> exp
    dep --> aether

    %% Styles
    classDef ui fill:#ffcccc,stroke:#cc0000,stroke-width:2px;
    classDef engine fill:#ccffcc,stroke:#006600,stroke-width:2px;
    classDef model fill:#ffffcc,stroke:#999900,stroke-width:2px;
    classDef artifacts fill:#cce5ff,stroke:#0044cc,stroke-width:2px;
    classDef experiments fill:#ffebcc,stroke:#e68a00,stroke-width:2px;
    classDef dependencies fill:#e6ccff,stroke:#800080,stroke-width:2px;

    %% Click Events
    click ui "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/app.py"
    click aether "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/Model/Aether.py"
    click lrlr "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/Model/LR+LDA+ResNet.py"
    click rfm "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/Model/Random_Forest_Model.py"
    click resnet "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/Model/resnet_model.py"
    click lr "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/Checkpoints/LR.pkl"
    click rf "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/Checkpoints/RF.pkl"
    click kmeans "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/Checkpoints/kmeans+lda+cnn.pkl"
    click resnetck "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/Checkpoints/resnet32.ckpt"
    click exp "https://github.com/prajnaagrawal26/image-retrieval_prml/tree/main/Experiments"
    click dep "https://github.com/prajnaagrawal26/image-retrieval_prml/blob/main/requirements.txt"
```
