# lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor architecture

> Architecture diagram of the GitHub repository lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor
- Repository: https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor

## Overview

##### Project Type and Purpose
- DermaEvolve is a monolithic, full-stack machine learning web application.
- Purpose: Allow users to upload skin‐lesion images via a Streamlit UI, preprocess them, run inference with one of several pre-trained CNN models, and display the predicted skin disease and confidence score in real time.

##### File-Structure Analysis
- Top-level artifacts:
- app.py – the Streamlit application entry point (UI + controller logic)
- Android_Compatible_models – collection of .tflite models for mobile deployment
- assets – static assets used by the UI
- Dataset_Sample & Dataset_And_Models_Analytics – offline data and Jupyter notebooks (for training/analysis)
- requirements.txt – dependency list
- .streamlit/config.toml & .devcontainer – environment configuration
- No separate “backend” or “frontend” directories: the Streamlit app handles both.

##### README Insights
- Technologies: Streamlit (web UI), TensorFlow (model loading + inference), OpenCV/Pillow (image preprocessing), NumPy/Matplotlib (data handling + visualization).
- Models supported: MobileNet, NASNet, Custom CNN, ResNet50, DenseNet169.
- Usage flow: image upload → preprocessing → model selection → inference → result display.

##### Main Components & Relationships
a. Streamlit Web UI
- Handles user interactions: image upload form, model-selection dropdown, “Predict” button, result display.
b. Preprocessing Module
- Uses OpenCV/Pillow to resize, normalize, and convert image to tensor form.
c. Model Inference Engine
- Loads TensorFlow models (from local storage: Android_Compatible_models or SavedModel files)
- Runs forward pass to produce predictions.
d. Local Model Storage
- Directory of .tflite and other model artifacts.
e. Result Renderer
- Streamlit components to show class label + confidence, confusion matrices (via Matplotlib).
f. (Optional) Offline Analytics
- Jupyter notebooks reading Dataset_Sample for data visualization and model comparison.

Interaction Flow:
User → Streamlit UI → Preprocessing Module → Model Inference Engine → Result Renderer → User

##### Architectural Patterns & Principles
- Monolithic ML-app pattern: single container (configured by .devcontainer) runs UI + inference.
- Separation of concerns: UI vs. preprocessing vs. inference vs. rendering.
- Extensibility: adding a new model means dropping its artifact into Android_Compatible_models and updating app.py.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User("User"):::external

    subgraph "Frontend: Streamlit Web UI"
        UI["Streamlit Web UI\n(app.py)"]:::frontend
        Config[".streamlit/config.toml"]:::frontend
        Assets["assets/"]:::frontend
        UI --> Config
        UI --> Assets
    end

    Pre["Preprocessing Module\n(OpenCV/Pillow, NumPy)"]:::processing
    Inf["Model Inference Engine\n(TensorFlow)"]:::processing
    Storage["Local Model Storage\n(Android_Compatible_models)"]:::storage
    Res["Result Renderer\n(Streamlit + Matplotlib)"]:::frontend

    subgraph "Offline Analytics"
        DS["Dataset_Sample"]:::storage
        AN["Analytics Notebooks"]:::analytics
        DS --> AN
    end

    User --> UI
    UI --> Pre
    Pre --> Inf
    Inf --> Res
    Res --> User
    Inf --> Storage

    classDef external fill:#f9f,stroke:#333,stroke-width:1px
    classDef frontend fill:#8ecae6,stroke:#333,stroke-width:1px
    classDef processing fill:#219ebc,stroke:#333,stroke-width:1px
    classDef storage fill:#adb5bd,stroke:#333,stroke-width:1px
    classDef analytics fill:#ffb703,stroke:#333,stroke-width:1px

    click UI "https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor/blob/main/app.py"
    click Config "https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor/blob/main/.streamlit/config.toml"
    click Assets "https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor/tree/main/assets/"
    click Pre "https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor/blob/main/app.py"
    click Inf "https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor/tree/main/Android_Compatible_models/"
    click Storage "https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor/tree/main/Android_Compatible_models/"
    click Res "https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor/blob/main/app.py"
    click DS "https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor/tree/main/Dataset_Sample/"
    click AN "https://github.com/lokeshbhaskarnr/dermaevolve---an-advanced-skin-disease-predictor/tree/main/Dataset_And_Models_Analytics/"
```
