# giabao2478/thesis-master architecture

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

- Interactive diagram: https://gitdiagram.com/giabao2478/thesis-master
- Repository: https://github.com/giabao2478/thesis-master

## Overview

SwinJSCC is a learned image joint source–channel coding system: a training or evaluation run loads image batches, encodes them, optionally simulates a communication channel, decodes reconstructions, and evaluates distortion. Its model supports multiple channel conditions and nested-rate/MRL variants. The README is empty, so the map relies on the source index and shown excerpts; some training and evaluation details are not visible in the sampled portions of main.py.

Main entry points: [`SwinJSCC/net/network.py`](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/network.py) (SwinJSCC model), [`SwinJSCC/main.py`](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/main.py) (Train and evaluate), [`SwinJSCC/net/decoder.py`](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/decoder.py) (Swin decoder), [`SwinJSCC/net/encoder.py`](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/encoder.py) (Swin encoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Run orchestration"]
  node_runner["Train and evaluate<br/>[main.py]"]
  node_images["Image datasets<br/>[datasets.py]"]
  node_helpers["Run utilities<br/>[utils.py]"]
end

subgraph group_model["Image codec"]
  node_codec["SwinJSCC model<br/>[network.py]"]
  node_encoder["Swin encoder<br/>[encoder.py]"]
  node_decoder["Swin decoder<br/>[decoder.py]"]
  node_swinblocks["Transformer blocks<br/>[modules.py]"]
end

subgraph group_channel["Channel and rates"]
  node_channel_model["Channel simulation<br/>[channel.py]"]
  node_mrl_projection["MRL projections<br/>[mrl.py]"]
end

subgraph group_objectives["Losses and quality"]
  node_distortion["Distortion metrics<br/>[distortion.py]"]
  node_matloss["Matryoshka loss<br/>[matryoshka_loss.py]"]
end

node_operator(("Run initiator"))

node_operator -->|"starts run"| node_runner
node_runner -->|"loads batches"| node_images
node_runner -->|"trains and evaluates"| node_codec
node_runner -->|"uses utilities"| node_helpers
node_codec -->|"encodes images"| node_encoder
node_codec -->|"transmits latents"| node_channel_model
node_codec -->|"decodes latents"| node_decoder
node_codec -->|"measures distortion"| node_distortion
node_codec -->|"computes nested loss"| node_matloss
node_codec -->|"projects prefixes"| node_mrl_projection
node_encoder -->|"uses blocks"| node_swinblocks
node_decoder -->|"uses blocks"| node_swinblocks
node_decoder -->|"reuses transformer block"| node_encoder

click node_runner "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/main.py"
click node_images "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/data/datasets.py"
click node_helpers "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/utils.py"
click node_codec "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/network.py"
click node_encoder "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/encoder.py"
click node_decoder "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/decoder.py"
click node_swinblocks "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/modules.py"
click node_channel_model "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/channel.py"
click node_mrl_projection "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/mrl.py"
click node_distortion "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/loss/distortion.py"
click node_matloss "https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/loss/matryoshka_loss.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_runner,node_images,node_helpers toneBlue
class node_codec,node_encoder,node_decoder,node_swinblocks toneAmber
class node_channel_model,node_mrl_projection toneMint
class node_distortion,node_matloss toneRose
class node_operator toneIndigo
```

## Components

### Run orchestration

- [Train and evaluate](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/main.py): `SwinJSCC/main.py`
- [Image datasets](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/data/datasets.py): `SwinJSCC/data/datasets.py`
- [Run utilities](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/utils.py): `SwinJSCC/utils.py`

### Image codec

- [SwinJSCC model](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/network.py): `SwinJSCC/net/network.py`
- [Swin encoder](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/encoder.py): `SwinJSCC/net/encoder.py`
- [Swin decoder](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/decoder.py): `SwinJSCC/net/decoder.py`
- [Transformer blocks](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/modules.py): `SwinJSCC/net/modules.py`

### Channel and rates

- [Channel simulation](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/channel.py): `SwinJSCC/net/channel.py`
- [MRL projections](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/net/mrl.py): `SwinJSCC/net/mrl.py`

### Losses and quality

- [Distortion metrics](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/loss/distortion.py): `SwinJSCC/loss/distortion.py`
- [Matryoshka loss](https://github.com/giabao2478/thesis-master/blob/main/SwinJSCC/loss/matryoshka_loss.py): `SwinJSCC/loss/matryoshka_loss.py`

### Other components

- **Run initiator**

## Connections

- Run initiator → Train and evaluate: starts run
- Train and evaluate → Image datasets: loads batches (evidence: `SwinJSCC/main.py`)
- Train and evaluate → SwinJSCC model: trains and evaluates (evidence: `SwinJSCC/main.py`)
- Train and evaluate → Run utilities: uses utilities (evidence: `SwinJSCC/main.py`)
- SwinJSCC model → Swin encoder: encodes images (evidence: `SwinJSCC/net/network.py`)
- SwinJSCC model → Channel simulation: transmits latents (evidence: `SwinJSCC/net/network.py`)
- SwinJSCC model → Swin decoder: decodes latents (evidence: `SwinJSCC/net/network.py`)
- SwinJSCC model → Distortion metrics: measures distortion (evidence: `SwinJSCC/net/network.py`)
- SwinJSCC model → Matryoshka loss: computes nested loss (evidence: `SwinJSCC/net/network.py`)
- SwinJSCC model → MRL projections: projects prefixes (evidence: `SwinJSCC/net/network.py`)
- Swin encoder → Transformer blocks: uses blocks (evidence: `SwinJSCC/net/encoder.py`)
- Swin decoder → Transformer blocks: uses blocks (evidence: `SwinJSCC/net/decoder.py`)
- Swin decoder → Swin encoder: reuses transformer block (evidence: `SwinJSCC/net/decoder.py`)
