# gjoshna18/covid-detection-ml architecture

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

- Interactive diagram: https://gitdiagram.com/gjoshna18/covid-detection-ml
- Repository: https://github.com/gjoshna18/covid-detection-ml

## Overview

This repository is a CT-image COVID-19 classification project: its user-facing workflow accepts an uploaded image, preprocesses it, predicts a class with a saved soft-voting model, and displays the result. Separate notebooks cover dataset conversion, histogram-based preprocessing, PCA/LDA feature reduction, and ensemble training. The app implementation is excerpted; notebook behavior and their detailed connections are represented only to the extent documented by the README and filenames. The referenced model artifacts are not present in the supplied tree.

Main entry points: [`ensemble model building.ipynb`](https://github.com/gjoshna18/covid-detection-ml/blob/main/ensemble%20model%20building.ipynb) (Ensemble training), [`app.py`](https://github.com/gjoshna18/covid-detection-ml/blob/main/app.py) (Prediction UI), [`HistogramEqualization.ipynb`](https://github.com/gjoshna18/covid-detection-ml/blob/main/HistogramEqualization.ipynb) (Histogram equalization), [`AdaptiveHistogram.ipynb`](https://github.com/gjoshna18/covid-detection-ml/blob/main/AdaptiveHistogram.ipynb) (Adaptive histogram)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Prediction interface"]
  node_streamlit["Prediction UI<br/>[app.py]"]
  node_prediction["Displayed prediction<br/>[app.py]"]
end

subgraph group_preprocessing["Image preprocessing"]
  node_image_preprocessing["Image preprocessing<br/>[app.py]"]
  node_histogram_equalization["Histogram equalization"]
  node_adaptive_histogram["Adaptive histogram"]
end

subgraph group_modeling["Feature engineering and modeling"]
  node_pca["PCA reduction"]
  node_lda["LDA reduction"]
  node_adaptive_pca["Adaptive PCA"]
  node_adaptive_lda["Adaptive LDA"]
  node_ensemble_training["Ensemble training"]
  node_ensemble_model["Soft-voting model"]
  node_label_encoder["Label decoder<br/>[app.py]"]
end

subgraph group_data["Dataset preparation"]
  node_dataset_conversion["Dataset conversion"]
  node_csv_merge["CSV merging<br/>[MergeCsv.ipynb]"]
end

node_user(("Image uploader"))

node_user -->|"uploads image"| node_streamlit
node_streamlit -->|"preprocesses image"| node_image_preprocessing
node_image_preprocessing -->|"supplies features"| node_ensemble_model
node_ensemble_model -->|"returns class"| node_label_encoder
node_label_encoder -->|"decodes label"| node_prediction
node_streamlit -->|"displays result"| node_prediction
node_histogram_equalization -.->|"supports reduction"| node_pca
node_histogram_equalization -.->|"supports reduction"| node_lda
node_adaptive_histogram -.->|"supports reduction"| node_adaptive_pca
node_adaptive_histogram -.->|"supports reduction"| node_adaptive_lda
node_dataset_conversion -.->|"prepares datasets"| node_csv_merge
node_pca -.->|"provides features"| node_ensemble_training
node_lda -.->|"provides features"| node_ensemble_training
node_adaptive_pca -.->|"provides features"| node_ensemble_training
node_adaptive_lda -.->|"provides features"| node_ensemble_training
node_ensemble_training -.->|"trains model"| node_ensemble_model

click node_streamlit "https://github.com/gjoshna18/covid-detection-ml/blob/main/app.py"
click node_image_preprocessing "https://github.com/gjoshna18/covid-detection-ml/blob/main/app.py"
click node_histogram_equalization "https://github.com/gjoshna18/covid-detection-ml/blob/main/HistogramEqualization.ipynb"
click node_adaptive_histogram "https://github.com/gjoshna18/covid-detection-ml/blob/main/AdaptiveHistogram.ipynb"
click node_dataset_conversion "https://github.com/gjoshna18/covid-detection-ml/blob/main/CsvConversion.ipynb"
click node_csv_merge "https://github.com/gjoshna18/covid-detection-ml/blob/main/MergeCsv.ipynb"
click node_pca "https://github.com/gjoshna18/covid-detection-ml/blob/main/HistogramEqualized_PCA.ipynb"
click node_lda "https://github.com/gjoshna18/covid-detection-ml/blob/main/HistogramEqualized_LDA.ipynb"
click node_adaptive_pca "https://github.com/gjoshna18/covid-detection-ml/blob/main/AdaptiveHistogram_PCA.ipynb"
click node_adaptive_lda "https://github.com/gjoshna18/covid-detection-ml/blob/main/AdaptiveHistogram_LDA.ipynb"
click node_ensemble_training "https://github.com/gjoshna18/covid-detection-ml/blob/main/ensemble%20model%20building.ipynb"
click node_label_encoder "https://github.com/gjoshna18/covid-detection-ml/blob/main/app.py"
click node_prediction "https://github.com/gjoshna18/covid-detection-ml/blob/main/app.py"

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_streamlit,node_prediction toneBlue
class node_image_preprocessing,node_histogram_equalization,node_adaptive_histogram toneAmber
class node_pca,node_lda,node_adaptive_pca,node_adaptive_lda,node_ensemble_training,node_ensemble_model,node_label_encoder toneMint
class node_dataset_conversion,node_csv_merge toneRose
class node_user toneIndigo
```

## Components

### Prediction interface

- [Prediction UI](https://github.com/gjoshna18/covid-detection-ml/blob/main/app.py): `app.py`
- [Displayed prediction](https://github.com/gjoshna18/covid-detection-ml/blob/main/app.py): `app.py`

### Image preprocessing

- [Image preprocessing](https://github.com/gjoshna18/covid-detection-ml/blob/main/app.py): `app.py`
- [Histogram equalization](https://github.com/gjoshna18/covid-detection-ml/blob/main/HistogramEqualization.ipynb): `HistogramEqualization.ipynb`
- [Adaptive histogram](https://github.com/gjoshna18/covid-detection-ml/blob/main/AdaptiveHistogram.ipynb): `AdaptiveHistogram.ipynb`

### Feature engineering and modeling

- [PCA reduction](https://github.com/gjoshna18/covid-detection-ml/blob/main/HistogramEqualized_PCA.ipynb): `HistogramEqualized_PCA.ipynb`
- [LDA reduction](https://github.com/gjoshna18/covid-detection-ml/blob/main/HistogramEqualized_LDA.ipynb): `HistogramEqualized_LDA.ipynb`
- [Adaptive PCA](https://github.com/gjoshna18/covid-detection-ml/blob/main/AdaptiveHistogram_PCA.ipynb): `AdaptiveHistogram_PCA.ipynb`
- [Adaptive LDA](https://github.com/gjoshna18/covid-detection-ml/blob/main/AdaptiveHistogram_LDA.ipynb): `AdaptiveHistogram_LDA.ipynb`
- [Ensemble training](https://github.com/gjoshna18/covid-detection-ml/blob/main/ensemble%20model%20building.ipynb): `ensemble model building.ipynb`
- **Soft-voting model**
- [Label decoder](https://github.com/gjoshna18/covid-detection-ml/blob/main/app.py): `app.py`

### Dataset preparation

- [Dataset conversion](https://github.com/gjoshna18/covid-detection-ml/blob/main/CsvConversion.ipynb): `CsvConversion.ipynb`
- [CSV merging](https://github.com/gjoshna18/covid-detection-ml/blob/main/MergeCsv.ipynb): `MergeCsv.ipynb`

### Other components

- **Image uploader**

## Connections

- Image uploader → Prediction UI: uploads image (evidence: `app.py`)
- Prediction UI → Image preprocessing: preprocesses image (evidence: `app.py`)
- Image preprocessing → Soft-voting model: supplies features (evidence: `app.py`)
- Soft-voting model → Label decoder: returns class (evidence: `app.py`)
- Label decoder → Displayed prediction: decodes label (evidence: `app.py`)
- Prediction UI → Displayed prediction: displays result (evidence: `app.py`)
- Histogram equalization → PCA reduction: supports reduction (evidence: `README.md`)
- Histogram equalization → LDA reduction: supports reduction (evidence: `README.md`)
- Adaptive histogram → Adaptive PCA: supports reduction (evidence: `README.md`)
- Adaptive histogram → Adaptive LDA: supports reduction (evidence: `README.md`)
- Dataset conversion → CSV merging: prepares datasets (evidence: `README.md`)
- PCA reduction → Ensemble training: provides features (evidence: `README.md`)
- LDA reduction → Ensemble training: provides features (evidence: `README.md`)
- Adaptive PCA → Ensemble training: provides features (evidence: `README.md`)
- Adaptive LDA → Ensemble training: provides features (evidence: `README.md`)
- Ensemble training → Soft-voting model: trains model (evidence: `README.md`)
