# guri10/deepfake-audio-detection-with-xai architecture

> Architecture diagram of the GitHub repository guri10/deepfake-audio-detection-with-xai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/guri10/deepfake-audio-detection-with-xai
- Repository: https://github.com/guri10/deepfake-audio-detection-with-xai

## Overview

The product is a deepfake-audio detector with a Streamlit interface and a separate notebook-based model-development workflow. The user path is WAV upload, spectrogram generation, saved-model classification, and optional LIME/Grad-CAM explanations. The README also describes GAN-generated samples, dataset augmentation, model comparison, and SHAP; those notebook capabilities are documented but their implementation and links were not sampled, so they are shown as a separate, cautiously connected development branch.

Main entry points: [`Streamlit/app.py`](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py) (Streamlit interface), [`Code/Audio_classifier.ipynb`](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Code/Audio_classifier.ipynb) (Audio classification study), [`Code`](https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Code) (Dataset augmentation), [`Streamlit/saved_model/model`](https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Streamlit/saved_model/model) (Saved classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Detection app"]
  node_ui["Streamlit interface<br/>[app.py]"]
  node_upload["WAV upload<br/>[app.py]"]
  node_classification["Audio classification<br/>[app.py]"]
end

subgraph group_models["Model development"]
  node_model["Saved classifier"]
  node_audio_notebook["Audio classification study"]
  node_model_comparison["CNN model comparison"]
  node_inception_mobile["Inception and MobileNet"]
end

subgraph group_data["Audio data"]
  node_spectrogram["Spectrogram generation<br/>[app.py]"]
  node_dataset[("Fake or Real dataset")]
  node_generation["GAN audio generation"]
  node_augmentation["Dataset augmentation"]
  node_spectrogram_notebook["Spectrogram conversion"]
end

subgraph group_explain["Explainability"]
  node_lime["LIME explanation<br/>[app.py]"]
  node_gradcam["Grad-CAM explanation<br/>[app.py]"]
  node_xai_study["XAI comparison"]
end

node_user(("Audio user"))

node_user -->|"uses"| node_ui
node_ui -->|"accepts WAV"| node_upload
node_upload -->|"creates spectrogram"| node_spectrogram
node_ui -->|"loads model"| node_model
node_ui -->|"invokes"| node_classification
node_classification -->|"predicts with"| node_model
node_classification -->|"classifies image"| node_spectrogram
node_ui -->|"invokes optionally"| node_lime
node_lime -->|"explains predictions"| node_model
node_ui -->|"invokes optionally"| node_gradcam
node_user -.->|"source recordings"| node_dataset
node_generation -.->|"supplies generated samples"| node_augmentation
node_dataset -.->|"augments samples"| node_augmentation
node_augmentation -.->|"trains on"| node_audio_notebook
node_dataset -.->|"converts audio"| node_spectrogram_notebook
node_audio_notebook -.->|"compares models"| node_model_comparison
node_audio_notebook -.->|"compares models"| node_inception_mobile
node_audio_notebook -.->|"evaluates explanations"| node_xai_study

click node_ui "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py"
click node_upload "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py"
click node_spectrogram "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py"
click node_model "https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Streamlit/saved_model/model"
click node_classification "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py"
click node_lime "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py"
click node_gradcam "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py"
click node_generation "https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Code"
click node_augmentation "https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Code"
click node_spectrogram_notebook "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Code/Spectrogram-converter.ipynb"
click node_audio_notebook "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Code/Audio_classifier.ipynb"
click node_model_comparison "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Code/VGG16-Custom%20CNN-ResNet.ipynb"
click node_inception_mobile "https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Code/InceptionV3-MobileNet.ipynb"
click node_xai_study "https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Code"

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_ui,node_upload,node_classification,node_user toneBlue
class node_model,node_audio_notebook,node_model_comparison,node_inception_mobile toneAmber
class node_spectrogram,node_dataset,node_generation,node_augmentation,node_spectrogram_notebook toneMint
class node_lime,node_gradcam,node_xai_study toneRose
```

## Components

### Detection app

- [Streamlit interface](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py): `Streamlit/app.py`
- [WAV upload](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py): `Streamlit/app.py`
- [Audio classification](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py): `Streamlit/app.py`

### Model development

- [Saved classifier](https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Streamlit/saved_model/model): `Streamlit/saved_model/model`
- [Audio classification study](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Code/Audio_classifier.ipynb): `Code/Audio_classifier.ipynb`
- [CNN model comparison](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Code/VGG16-Custom%20CNN-ResNet.ipynb): `Code/VGG16-Custom CNN-ResNet.ipynb`
- [Inception and MobileNet](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Code/InceptionV3-MobileNet.ipynb): `Code/InceptionV3-MobileNet.ipynb`

### Audio data

- [Spectrogram generation](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py): `Streamlit/app.py`
- **Fake or Real dataset**
- [GAN audio generation](https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Code): `Code`
- [Dataset augmentation](https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Code): `Code`
- [Spectrogram conversion](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Code/Spectrogram-converter.ipynb): `Code/Spectrogram-converter.ipynb`

### Explainability

- [LIME explanation](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py): `Streamlit/app.py`
- [Grad-CAM explanation](https://github.com/guri10/deepfake-audio-detection-with-xai/blob/main/Streamlit/app.py): `Streamlit/app.py`
- [XAI comparison](https://github.com/guri10/deepfake-audio-detection-with-xai/tree/main/Code): `Code`

### Other components

- **Audio user**

## Connections

- Audio user → Streamlit interface: uses (evidence: `README.md`)
- Streamlit interface → WAV upload: accepts WAV (evidence: `Streamlit/app.py`)
- WAV upload → Spectrogram generation: creates spectrogram (evidence: `Streamlit/app.py`)
- Streamlit interface → Saved classifier: loads model (evidence: `Streamlit/app.py`)
- Streamlit interface → Audio classification: invokes (evidence: `Streamlit/app.py`)
- Audio classification → Saved classifier: predicts with (evidence: `Streamlit/app.py`)
- Audio classification → Spectrogram generation: classifies image (evidence: `Streamlit/app.py`)
- Streamlit interface → LIME explanation: invokes optionally (evidence: `Streamlit/app.py`)
- LIME explanation → Saved classifier: explains predictions (evidence: `Streamlit/app.py`)
- Streamlit interface → Grad-CAM explanation: invokes optionally (evidence: `Streamlit/app.py`)
- Audio user → Fake or Real dataset: source recordings (evidence: `README.md`)
- GAN audio generation → Dataset augmentation: supplies generated samples (evidence: `README.md`)
- Fake or Real dataset → Dataset augmentation: augments samples (evidence: `README.md`)
- Dataset augmentation → Audio classification study: trains on (evidence: `README.md`)
- Fake or Real dataset → Spectrogram conversion: converts audio (evidence: `README.md`)
- Audio classification study → CNN model comparison: compares models (evidence: `README.md`)
- Audio classification study → Inception and MobileNet: compares models (evidence: `README.md`)
- Audio classification study → XAI comparison: evaluates explanations (evidence: `README.md`)
