# akshat8102005/denoising-images architecture

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

- Interactive diagram: https://gitdiagram.com/akshat8102005/denoising-images
- Repository: https://github.com/akshat8102005/denoising-images

## Overview

This repository implements an image-denoising workflow: training loads paired noisy/clean NumPy images, fits a residual CNN, and saves its best checkpoint; evaluation loads a checkpoint, denoises test images, and reports PSNR/SSIM while saving predictions and metrics. A separate baseline CNN is present, while README-listed future architectures and LPIPS comparison are roadmap items, not evidenced runtime components. Edges are limited to relationships shown in the sampled source or README; external dataset locations are represented as actors.

Main entry points: [`evaluate.py`](https://github.com/akshat8102005/denoising-images/blob/main/evaluate.py) (Inference and evaluation), [`train.py`](https://github.com/akshat8102005/denoising-images/blob/main/train.py) (Model training), [`datasets/dataset.py`](https://github.com/akshat8102005/denoising-images/blob/main/datasets/dataset.py) (Paired dataset loader), [`results/checkpoints`](https://github.com/akshat8102005/denoising-images/tree/main/results/checkpoints) (Model checkpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_training["Data and training"]
  node_dataset_loader["Paired dataset loader<br/>[dataset.py]"]
  node_training["Model training<br/>[train.py]"]
  node_checkpoint[("Model checkpoint")]
end

subgraph group_models["Denoising models"]
  node_residual_model["Residual CNN<br/>[residual_cnn.py]"]
  node_baseline_model["Baseline CNN<br/>[baseline_cnn.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_evaluation["Inference and evaluation<br/>[evaluate.py]"]
  node_psnr["PSNR metric<br/>[psnr.py]"]
  node_ssim["SSIM metric<br/>[ssim.py]"]
  node_predictions[("Saved predictions")]
  node_metric_report["Evaluation report<br/>[metrics.txt]"]
end

node_dataset_files(("Paired image files"))
node_test_files(("Test image files"))

node_dataset_files -->|"provides pairs"| node_dataset_loader
node_training -->|"loads batches"| node_dataset_loader
node_training -->|"trains"| node_residual_model
node_training -->|"saves best weights"| node_checkpoint
node_test_files -->|"provides images"| node_evaluation
node_evaluation -->|"runs inference"| node_residual_model
node_evaluation -->|"loads weights"| node_checkpoint
node_evaluation -->|"calculates"| node_psnr
node_evaluation -->|"calculates"| node_ssim
node_evaluation -->|"writes predictions"| node_predictions
node_evaluation -->|"writes averages"| node_metric_report

click node_dataset_loader "https://github.com/akshat8102005/denoising-images/blob/main/datasets/dataset.py"
click node_training "https://github.com/akshat8102005/denoising-images/blob/main/train.py"
click node_residual_model "https://github.com/akshat8102005/denoising-images/blob/main/models/residual_cnn.py"
click node_baseline_model "https://github.com/akshat8102005/denoising-images/blob/main/models/baseline_cnn.py"
click node_checkpoint "https://github.com/akshat8102005/denoising-images/tree/main/results/checkpoints"
click node_evaluation "https://github.com/akshat8102005/denoising-images/blob/main/evaluate.py"
click node_psnr "https://github.com/akshat8102005/denoising-images/blob/main/metrics/psnr.py"
click node_ssim "https://github.com/akshat8102005/denoising-images/blob/main/metrics/ssim.py"
click node_metric_report "https://github.com/akshat8102005/denoising-images/blob/main/results/residual/metrics.txt"

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_dataset_loader,node_training,node_checkpoint toneBlue
class node_residual_model,node_baseline_model toneAmber
class node_evaluation,node_psnr,node_ssim,node_predictions,node_metric_report toneMint
class node_dataset_files,node_test_files toneIndigo
```

## Components

### Data and training

- [Paired dataset loader](https://github.com/akshat8102005/denoising-images/blob/main/datasets/dataset.py): `datasets/dataset.py`
- [Model training](https://github.com/akshat8102005/denoising-images/blob/main/train.py): `train.py`
- [Model checkpoint](https://github.com/akshat8102005/denoising-images/tree/main/results/checkpoints): `results/checkpoints`

### Denoising models

- [Residual CNN](https://github.com/akshat8102005/denoising-images/blob/main/models/residual_cnn.py): `models/residual_cnn.py`
- [Baseline CNN](https://github.com/akshat8102005/denoising-images/blob/main/models/baseline_cnn.py): `models/baseline_cnn.py`

### Evaluation

- [Inference and evaluation](https://github.com/akshat8102005/denoising-images/blob/main/evaluate.py): `evaluate.py`
- [PSNR metric](https://github.com/akshat8102005/denoising-images/blob/main/metrics/psnr.py): `metrics/psnr.py`
- [SSIM metric](https://github.com/akshat8102005/denoising-images/blob/main/metrics/ssim.py): `metrics/ssim.py`
- **Saved predictions**
- [Evaluation report](https://github.com/akshat8102005/denoising-images/blob/main/results/residual/metrics.txt): `results/residual/metrics.txt`

### Other components

- **Paired image files**
- **Test image files**

## Connections

- Paired image files → Paired dataset loader: provides pairs (evidence: `datasets/dataset.py`)
- Model training → Paired dataset loader: loads batches (evidence: `train.py`)
- Model training → Residual CNN: trains (evidence: `train.py`)
- Model training → Model checkpoint: saves best weights (evidence: `train.py`)
- Test image files → Inference and evaluation: provides images (evidence: `evaluate.py`)
- Inference and evaluation → Residual CNN: runs inference (evidence: `evaluate.py`)
- Inference and evaluation → Model checkpoint: loads weights (evidence: `evaluate.py`)
- Inference and evaluation → PSNR metric: calculates (evidence: `evaluate.py`)
- Inference and evaluation → SSIM metric: calculates (evidence: `evaluate.py`)
- Inference and evaluation → Saved predictions: writes predictions (evidence: `evaluate.py`)
- Inference and evaluation → Evaluation report: writes averages (evidence: `evaluate.py`)
