# krisho9/featureextraction-bah24 architecture

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

- Interactive diagram: https://gitdiagram.com/krisho9/featureextraction-bah24
- Repository: https://github.com/krisho9/featureextraction-bah24

## Overview

##### Overall Project Type and Purpose
- The project centers on developing a deep learning model that performs feature extraction (object detection with YOLO, semantic segmentation through a U-Net decoder, and image-level classification) on satellite imagery. It integrates data preprocessing using geospatial tools (GDAL, QGIS, OpenCV) and deploys a Streamlit web application which also collects user feedback stored in MongoDB.
- The key architectural sections will include the data preprocessing pipeline, the deep learning model pipeline, and the deployment/inference interface.

##### Project's File Structure
- Although the file tree is minimal, it hints at several script files (e.g., YOLOv8L.py and edge_new.py) and a notebook (mobile.ipynb) likely used for experimentation or demonstration purposes. The README file gives a clear outline of the multiple components of the ML architecture.
- Files like requirements.txt ensure that dependencies are clearly defined and that the system uses specified versions of Python and frameworks (PyTorch, Streamlit, etc.).

##### Key Components
a. Preprocessing Tools and Data Sources:
- Tools: GDAL (for handling geospatial satellite imagery formats), QGIS (for labeling and data annotation), and OpenCV (for further processing like applying masks or image augmentation).
- Input Data: High-resolution satellite imagery (of remote structures like high tension towers, windmills, substations, etc.).

b. Deep Learning Model Pipeline:
- Shared ResNet50 Backbone: Acts as the common feature extractor (pretrained on ImageNet and later fine-tuned).
- U-Net Decoder: Responsible for generating pixel-level segmentation masks. Indicate loss functions (Dice Loss + Focal Loss) and mention activation functions.
- Classification Branch: Performs overall image-level classification with components like global average pooling, fully-connected layers, dropout, and batch normalization.

c. Deployment and User Interaction:
- Web Application: Built with Streamlit — illustrates how model outputs are served in an interactive UI.
- User Feedback Loop: The Streamlit UI sends feedback which is stored in a MongoDB database for continuous model improvement.
- Beta Features: Include tracking similar features and real-time satellite image analysis.

##### Detailed Components
- Don’t oversimplify: separate the project into as many distinct areas as possible. For example, clearly mark the preprocessing tools separately from the deep learning model.
- If possible, include notes on key training parameters (e.g., learning rate details for fine-tuning) near the corresponding components.
- Integration of external APIs or modules if applicable (like database connections in the deployment step).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Documentation Subgraph
    subgraph "Project Documentation & Dependencies"
        Doc1("README.md"):::documentation
        Doc2("requirements.txt"):::documentation
    end

    %% Core Data Ingestion and Preprocessing
    A("Input Data: Satellite Imagery"):::input
    B("Preprocessing: GDAL, QGIS, OpenCV"):::preprocess

    %% Data Augmentation & Regularization note
    H("Data Augmentation & Regularization"):::augmentation

    %% Deep Learning Pipeline with Shared Backbone and Branches
    D("Shared Backbone: ResNet50"):::model
    E("U-Net Decoder (Segmentation)"):::segmentation
    F("YOLO Head (Detection)"):::detection
    G("Classification Branch (Image-level)"):::classification

    %% Model Output and Deployment
    I("Model Outputs: BoundingBoxes,SegmentationMasks,ClassificationLabels"):::output
    J("Streamlit Web App Interface"):::deployment
    K("MongoDB (User Feedback Storage)"):::database

    %% Auxiliary Tools & Libraries (Side component)
    M("Auxiliary Tools & Libraries: Python v3.11,PyTorch,GDAL,QGIS,OpenCV"):::auxiliary

    %% Connections
    Doc2 -->|"informs"| A
    A -->|"processedBy"| B
    B -->|"augments"| H
    H -->|"feeds"| D
    D -->|"branchesTo"| E
    D -->|"branchesTo"| F
    D -->|"branchesTo"| G
    E -->|"mergesTo"| I
    F -->|"mergesTo"| I
    G -->|"mergesTo"| I
    I -->|"servedVia"| J
    J -->|"storesFeedbackIn"| K
    M -.->|"supports"| B

    %% Click Events
    click Doc1 "https://github.com/krisho9/featureextraction-bah24/blob/main/README.md"
    click Doc2 "https://github.com/krisho9/featureextraction-bah24/blob/main/requirements.txt"
    click F "https://github.com/krisho9/featureextraction-bah24/blob/main/YOLOv8L.py"
    click E "https://github.com/krisho9/featureextraction-bah24/blob/main/edge_new.py"
    click G "https://github.com/krisho9/featureextraction-bah24/blob/main/mobile.ipynb"

    %% Styles
    classDef input fill:#f9c,stroke:#333,stroke-width:2px;
    classDef preprocess fill:#ccf,stroke:#333,stroke-width:2px;
    classDef augmentation fill:#cff,stroke:#333,stroke-width:2px;
    classDef model fill:#fc9,stroke:#333,stroke-width:2px;
    classDef segmentation fill:#9cf,stroke:#333,stroke-width:2px;
    classDef detection fill:#f99,stroke:#333,stroke-width:2px;
    classDef classification fill:#ff9,stroke:#333,stroke-width:2px;
    classDef output fill:#fcf,stroke:#333,stroke-width:2px;
    classDef deployment fill:#c9f,stroke:#333,stroke-width:2px;
    classDef database fill:#fcc,stroke:#333,stroke-width:2px;
    classDef documentation fill:#eef,stroke:#333,stroke-width:2px;
    classDef auxiliary fill:#efe,stroke:#333,stroke-width:2px;
```
