# lijiyidong/segca-net architecture

> Architecture diagram of the GitHub repository lijiyidong/segca-net, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lijiyidong/segca-net
- Repository: https://github.com/lijiyidong/segca-net

## Overview

SEGCA-Net is a low-light image-enhancement training project. The evidenced workflow loads paired low/high images, prepares training or validation samples, runs HGETNet, computes a task-specific loss, and updates the model; validation scores guide best-checkpoint saving. The README gives only the project name, and the tree omits imported model and utility modules, so their implementations and some metric wiring cannot be verified from the supplied files.

Main entry points: [`train.py`](https://github.com/lijiyidong/segca-net/blob/main/train.py) (Training loop), [`data_RGB.py`](https://github.com/lijiyidong/segca-net/blob/main/data_RGB.py) (Dataset factories), [`dataset_RGB.py`](https://github.com/lijiyidong/segca-net/blob/main/dataset_RGB.py) (Image datasets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Image data"]
  node_dataset_api["Dataset factories<br/>[data_RGB.py]"]
  node_dataset_impl["Image datasets<br/>[dataset_RGB.py]"]
end

subgraph group_training["Model training"]
  node_trainer["Training loop<br/>[train.py]"]
  node_hgetnet["HGETNet"]
  node_loss["Enhancement loss"]
end

subgraph group_artifacts["Evaluation artifacts"]
  node_validation_metrics["Validation metrics"]
  node_checkpoints["Model checkpoints<br/>[train.py]"]
  node_training_logs["Training logs<br/>[train.py]"]
end

node_paired_images(("Paired images"))

node_paired_images -->|"provides pairs"| node_dataset_api
node_trainer -->|"requests datasets"| node_dataset_api
node_dataset_api -->|"constructs"| node_dataset_impl
node_trainer -->|"runs forward"| node_hgetnet
node_trainer -->|"computes loss"| node_loss
node_trainer -->|"scores validation"| node_validation_metrics
node_trainer -->|"saves weights"| node_checkpoints
node_trainer -->|"writes scalars"| node_training_logs

click node_trainer "https://github.com/lijiyidong/segca-net/blob/main/train.py"
click node_dataset_api "https://github.com/lijiyidong/segca-net/blob/main/data_RGB.py"
click node_dataset_impl "https://github.com/lijiyidong/segca-net/blob/main/dataset_RGB.py"
click node_checkpoints "https://github.com/lijiyidong/segca-net/blob/main/train.py"
click node_training_logs "https://github.com/lijiyidong/segca-net/blob/main/train.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_dataset_api,node_dataset_impl toneBlue
class node_trainer,node_hgetnet,node_loss toneAmber
class node_validation_metrics,node_checkpoints,node_training_logs toneMint
class node_paired_images toneIndigo
```

## Components

### Image data

- [Dataset factories](https://github.com/lijiyidong/segca-net/blob/main/data_RGB.py): `data_RGB.py`
- [Image datasets](https://github.com/lijiyidong/segca-net/blob/main/dataset_RGB.py): `dataset_RGB.py`

### Model training

- [Training loop](https://github.com/lijiyidong/segca-net/blob/main/train.py): `train.py`
- **HGETNet**
- **Enhancement loss**

### Evaluation artifacts

- **Validation metrics**
- [Model checkpoints](https://github.com/lijiyidong/segca-net/blob/main/train.py): `train.py`
- [Training logs](https://github.com/lijiyidong/segca-net/blob/main/train.py): `train.py`

### Other components

- **Paired images**

## Connections

- Paired images → Dataset factories: provides pairs
- Training loop → Dataset factories: requests datasets
- Dataset factories → Image datasets: constructs
- Training loop → HGETNet: runs forward
- Training loop → Enhancement loss: computes loss
- Training loop → Validation metrics: scores validation
- Training loop → Model checkpoints: saves weights
- Training loop → Training logs: writes scalars
