# sivapanyam/image_captioning_model architecture

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

- Interactive diagram: https://gitdiagram.com/sivapanyam/image_captioning_model
- Repository: https://github.com/sivapanyam/image_captioning_model

## Overview

This repository is currently a Flickr8k data-preparation scaffold for an image-captioning project, not a complete caption-generation system. Its implemented workflow configures dataset paths, creates and reads image splits, checks dataset consistency, and reports caption statistics. The README also describes the intended ResNet50-to-LSTM training, evaluation, and inference capabilities, but their implementation directories are absent from the tree. Those documented stages are shown as planned; their internal wiring is not evidenced here.

Main entry points: [`configs/config.py`](https://github.com/sivapanyam/image_captioning_model/blob/main/configs/config.py) (Dataset config), [`src/preprocessing/check_dataset.py`](https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/check_dataset.py) (Dataset verifier), [`src/preprocessing/create_splits.py`](https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/create_splits.py) (Split creator), [`dataset/Flickr8k`](https://github.com/sivapanyam/image_captioning_model/tree/main/dataset/Flickr8k) (Image split files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Configuration"]
  node_config["Dataset config<br/>[config.py]"]
end

subgraph group_prep["Dataset preparation"]
  node_captions["Caption annotations"]
  node_split_creator["Split creator<br/>[create_splits.py]"]
  node_split_files["Image split files"]
  node_split_reader["Split reader<br/>[read_splits.py]"]
  node_dataset_check["Dataset verifier<br/>[check_dataset.py]"]
  node_path_check["Path verifier<br/>[file_utils.py]"]
  node_caption_inspector["Caption inspector<br/>[read_captions.py]"]
  node_dataset_stats["Caption statistics<br/>[dataset_stats.py]"]
end

subgraph group_captioning["Captioning system &#40;planned&#41;"]
  node_encoder["ResNet50 encoder"]
  node_decoder["LSTM decoder"]
  node_training["Model training"]
  node_evaluation["Caption evaluation"]
  node_inference["Caption inference"]
  node_caption_result["Generated caption"]
end

node_engineer(("Dataset maintainer"))

node_engineer -->|"creates splits"| node_split_creator
node_split_creator -->|"reads paths"| node_config
node_split_creator -->|"reads annotations"| node_captions
node_split_creator -->|"writes splits"| node_split_files
node_split_reader -->|"reads paths"| node_config
node_split_reader -->|"reads splits"| node_split_files
node_dataset_check -->|"reads paths"| node_config
node_dataset_check -->|"verifies paths"| node_path_check
node_dataset_check -->|"counts annotations"| node_captions
node_dataset_check -->|"checks counts"| node_split_files
node_caption_inspector -->|"reads path"| node_config
node_caption_inspector -->|"prints samples"| node_captions
node_dataset_stats -->|"reads paths"| node_config
node_dataset_stats -->|"counts captions"| node_captions
node_training -.->|"uses encoder"| node_encoder
node_training -.->|"uses decoder"| node_decoder
node_evaluation -.->|"evaluates captions"| node_decoder
node_inference -.->|"extracts features"| node_encoder
node_inference -.->|"generates text"| node_decoder
node_inference -.->|"produces"| node_caption_result

click node_config "https://github.com/sivapanyam/image_captioning_model/blob/main/configs/config.py"
click node_split_creator "https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/create_splits.py"
click node_split_files "https://github.com/sivapanyam/image_captioning_model/tree/main/dataset/Flickr8k"
click node_split_reader "https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/read_splits.py"
click node_dataset_check "https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/check_dataset.py"
click node_path_check "https://github.com/sivapanyam/image_captioning_model/blob/main/src/utils/file_utils.py"
click node_caption_inspector "https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/read_captions.py"
click node_dataset_stats "https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/dataset_stats.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_config toneBlue
class node_captions,node_split_creator,node_split_files,node_split_reader,node_dataset_check,node_path_check,node_caption_inspector,node_dataset_stats toneAmber
class node_encoder,node_decoder,node_training,node_evaluation,node_inference,node_caption_result toneMint
class node_engineer toneIndigo
```

## Components

### Configuration

- [Dataset config](https://github.com/sivapanyam/image_captioning_model/blob/main/configs/config.py): `configs/config.py`

### Dataset preparation

- **Caption annotations**
- [Split creator](https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/create_splits.py): `src/preprocessing/create_splits.py`
- [Image split files](https://github.com/sivapanyam/image_captioning_model/tree/main/dataset/Flickr8k): `dataset/Flickr8k`
- [Split reader](https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/read_splits.py): `src/preprocessing/read_splits.py`
- [Dataset verifier](https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/check_dataset.py): `src/preprocessing/check_dataset.py`
- [Path verifier](https://github.com/sivapanyam/image_captioning_model/blob/main/src/utils/file_utils.py): `src/utils/file_utils.py`
- [Caption inspector](https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/read_captions.py): `src/preprocessing/read_captions.py`
- [Caption statistics](https://github.com/sivapanyam/image_captioning_model/blob/main/src/preprocessing/dataset_stats.py): `src/preprocessing/dataset_stats.py`

### Captioning system (planned)

- **ResNet50 encoder**
- **LSTM decoder**
- **Model training**
- **Caption evaluation**
- **Caption inference**
- **Generated caption**

### Other components

- **Dataset maintainer**

## Connections

- Dataset maintainer → Split creator: creates splits (evidence: `src/preprocessing/create_splits.py`)
- Split creator → Dataset config: reads paths (evidence: `src/preprocessing/create_splits.py`)
- Split creator → Caption annotations: reads annotations (evidence: `src/preprocessing/create_splits.py`)
- Split creator → Image split files: writes splits (evidence: `src/preprocessing/create_splits.py`)
- Split reader → Dataset config: reads paths (evidence: `src/preprocessing/read_splits.py`)
- Split reader → Image split files: reads splits (evidence: `src/preprocessing/read_splits.py`)
- Dataset verifier → Dataset config: reads paths (evidence: `src/preprocessing/check_dataset.py`)
- Dataset verifier → Path verifier: verifies paths (evidence: `src/preprocessing/check_dataset.py`)
- Dataset verifier → Caption annotations: counts annotations (evidence: `src/preprocessing/check_dataset.py`)
- Dataset verifier → Image split files: checks counts (evidence: `src/preprocessing/check_dataset.py`)
- Caption inspector → Dataset config: reads path (evidence: `src/preprocessing/read_captions.py`)
- Caption inspector → Caption annotations: prints samples (evidence: `src/preprocessing/read_captions.py`)
- Caption statistics → Dataset config: reads paths (evidence: `src/preprocessing/dataset_stats.py`)
- Caption statistics → Caption annotations: counts captions (evidence: `src/preprocessing/dataset_stats.py`)
- Model training → ResNet50 encoder: uses encoder (evidence: `README.md`)
- Model training → LSTM decoder: uses decoder (evidence: `README.md`)
- Caption evaluation → LSTM decoder: evaluates captions (evidence: `README.md`)
- Caption inference → ResNet50 encoder: extracts features (evidence: `README.md`)
- Caption inference → LSTM decoder: generates text (evidence: `README.md`)
- Caption inference → Generated caption: produces (evidence: `README.md`)
