# shaziyahussain/skin-disease-detection-cnn architecture

> Architecture diagram of the GitHub repository shaziyahussain/skin-disease-detection-cnn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shaziyahussain/skin-disease-detection-cnn
- Repository: https://github.com/shaziyahussain/skin-disease-detection-cnn

## Overview

This repository provides a Flask skin-disease classification API: clients submit images, the service preprocesses them for a TensorFlow CNN, and returns a class and confidence. At startup, app.py downloads its serving model from Google Cloud Storage. The README also describes CNN training in Colab, and train.ipynb is present, but its contents were not sampled, so training-to-model relationships are left unverified.

Main entry points: [`app.py`](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py) (Prediction route), [`train.ipynb`](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/train.ipynb) (CNN training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_flask["Flask routes<br/>[app.py]"]
  node_health["Health check<br/>[app.py]"]
  node_predict["Prediction route<br/>[app.py]"]
  node_response["Class response<br/>[app.py]"]
  node_cloud_run["Cloud Run"]
end

subgraph group_inference["Image inference"]
  node_preprocess["Image preprocessing<br/>[app.py]"]
  node_classifier["CNN inference<br/>[app.py]"]
end

subgraph group_model["Model operations"]
  node_gcs[("Google Cloud Storage")]
  node_model_loader["Model download and load<br/>[app.py]"]
  node_training["CNN training<br/>[train.ipynb]"]
end

node_client(("API client"))

node_client -->|"sends request"| node_flask
node_flask -->|"routes GET /"| node_health
node_flask -->|"routes POST /predict"| node_predict
node_predict -->|"decodes and resizes"| node_preprocess
node_preprocess -->|"provides image array"| node_classifier
node_predict -->|"calls prediction"| node_classifier
node_predict -->|"returns class and confidence"| node_response
node_model_loader -->|"downloads model"| node_gcs
node_model_loader -->|"loads model"| node_classifier
node_training -.->|"may supply model"| node_gcs
node_cloud_run -->|"hosts API"| node_flask

click node_flask "https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py"
click node_health "https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py"
click node_predict "https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py"
click node_preprocess "https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py"
click node_classifier "https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py"
click node_response "https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py"
click node_model_loader "https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py"
click node_training "https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/train.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flask,node_health,node_predict,node_response,node_cloud_run,node_client toneBlue
class node_preprocess,node_classifier toneAmber
class node_gcs,node_model_loader,node_training toneMint
```

## Components

### API

- [Flask routes](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py): `app.py`
- [Health check](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py): `app.py`
- [Prediction route](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py): `app.py`
- [Class response](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py): `app.py`
- **Cloud Run**

### Image inference

- [Image preprocessing](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py): `app.py`
- [CNN inference](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py): `app.py`

### Model operations

- **Google Cloud Storage**
- [Model download and load](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/app.py): `app.py`
- [CNN training](https://github.com/shaziyahussain/skin-disease-detection-cnn/blob/main/train.ipynb): `train.ipynb`

### Other components

- **API client**

## Connections

- API client → Flask routes: sends request (evidence: `README.md`)
- Flask routes → Health check: routes GET / (evidence: `app.py`)
- Flask routes → Prediction route: routes POST /predict (evidence: `app.py`)
- Prediction route → Image preprocessing: decodes and resizes (evidence: `app.py`)
- Image preprocessing → CNN inference: provides image array (evidence: `app.py`)
- Prediction route → CNN inference: calls prediction (evidence: `app.py`)
- Prediction route → Class response: returns class and confidence (evidence: `app.py`)
- Model download and load → Google Cloud Storage: downloads model (evidence: `app.py`)
- Model download and load → CNN inference: loads model (evidence: `app.py`)
- CNN training → Google Cloud Storage: may supply model
- Cloud Run → Flask routes: hosts API (evidence: `README.md`)
