# kentucky-kaneki/adversarial_chest_xray_models architecture

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

- Interactive diagram: https://gitdiagram.com/kentucky-kaneki/adversarial_chest_xray_models
- Repository: https://github.com/kentucky-kaneki/adversarial_chest_xray_models

## Overview

This repository is a chest X-ray adversarial-robustness experiment, centered on a notebook and three DenseNet-121 variants. Its documented workflow compares a baseline, a clean-image fine-tuned model, and an adversarially trained robust model under several attacks, including a CLAHE comparison. The tree also contains model checkpoints, sample arrays, and result tables. Source excerpts were unavailable, so the graph shows only README-supported relationships; links from the notebook to individual result files are omitted rather than assumed.

Main entry points: [`home/working/densenet121_robust.pth`](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/working/densenet121_robust.pth) (Robust model), [`home/adversarial_xray_combined.ipynb`](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/adversarial_xray_combined.ipynb) (Adversarial attacks), [`home/results/baseline`](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/baseline) (Baseline model), [`home/working/densenet121_finetuned.pth`](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/working/densenet121_finetuned.pth) (Fine-tuned model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Experiment"]
  node_notebook["Experiment notebook"]
  node_samples[("Sample arrays<br/>[sample_images.npy]")]
end

subgraph group_models["Model variants"]
  node_baseline["Baseline model"]
  node_finetuned["Fine-tuned model"]
  node_robust["Robust model"]
end

subgraph group_evaluation["Evaluation outputs"]
  node_attacks["Adversarial attacks"]
  node_clahe["CLAHE comparison"]
  node_baseline_results["Baseline results"]
  node_finetuned_results["Fine-tuned results"]
  node_robust_results["Robust results"]
  node_analysis_results["Comparative analyses"]
end

node_researcher(("Researcher"))
node_nih[("NIH Chest X-ray")]

node_researcher -->|"executes"| node_notebook
node_nih -->|"trains"| node_baseline
node_nih -->|"trains"| node_finetuned
node_nih -->|"trains"| node_robust
node_baseline -->|"evaluated under"| node_attacks
node_finetuned -->|"evaluated under"| node_attacks
node_robust -->|"evaluated under"| node_attacks
node_robust -->|"compared with"| node_clahe

click node_notebook "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/adversarial_xray_combined.ipynb"
click node_baseline "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/baseline"
click node_finetuned "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/working/densenet121_finetuned.pth"
click node_robust "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/working/densenet121_robust.pth"
click node_attacks "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/adversarial_xray_combined.ipynb"
click node_clahe "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/adversarial_xray_combined.ipynb"
click node_baseline_results "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/baseline"
click node_finetuned_results "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/fine-tuned"
click node_robust_results "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/robust"
click node_analysis_results "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/others"
click node_samples "https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/sample_images.npy"

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_notebook,node_samples toneBlue
class node_baseline,node_finetuned,node_robust,node_nih toneAmber
class node_attacks,node_clahe,node_baseline_results,node_finetuned_results,node_robust_results,node_analysis_results toneMint
class node_researcher toneIndigo
```

## Components

### Experiment

- [Experiment notebook](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/adversarial_xray_combined.ipynb): `home/adversarial_xray_combined.ipynb`
- [Sample arrays](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/sample_images.npy): `home/sample_images.npy`

### Model variants

- [Baseline model](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/baseline): `home/results/baseline`
- [Fine-tuned model](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/working/densenet121_finetuned.pth): `home/working/densenet121_finetuned.pth`
- [Robust model](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/working/densenet121_robust.pth): `home/working/densenet121_robust.pth`

### Evaluation outputs

- [Adversarial attacks](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/adversarial_xray_combined.ipynb): `home/adversarial_xray_combined.ipynb`
- [CLAHE comparison](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/blob/main/home/adversarial_xray_combined.ipynb): `home/adversarial_xray_combined.ipynb`
- [Baseline results](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/baseline): `home/results/baseline`
- [Fine-tuned results](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/fine-tuned): `home/results/fine-tuned`
- [Robust results](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/robust): `home/results/robust`
- [Comparative analyses](https://github.com/kentucky-kaneki/adversarial_chest_xray_models/tree/main/home/results/others): `home/results/others`

### Other components

- **Researcher**
- **NIH Chest X-ray**

## Connections

- Researcher → Experiment notebook: executes (evidence: `README.md`)
- NIH Chest X-ray → Baseline model: trains (evidence: `README.md`)
- NIH Chest X-ray → Fine-tuned model: trains (evidence: `README.md`)
- NIH Chest X-ray → Robust model: trains (evidence: `README.md`)
- Baseline model → Adversarial attacks: evaluated under (evidence: `README.md`)
- Fine-tuned model → Adversarial attacks: evaluated under (evidence: `README.md`)
- Robust model → Adversarial attacks: evaluated under (evidence: `README.md`)
- Robust model → CLAHE comparison: compared with (evidence: `README.md`)
