# ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40 architecture

> Architecture diagram of the GitHub repository ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40
- Repository: https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40

## Overview

This project compares image-to-caption approaches on three reproducible synthetic datasets and exposes selected trained models through a Streamlit demo. The main user workflow is choosing a task and either uploading an image or sampling a test image, then receiving a caption; the MultiHead model also reports per-attribute confidence. Separate data-generation, training, and evaluation workflows support the comparison. Some subsystem links are based on README statements or SOURCE INDEX references because their full implementation was not excerpted.

Main entry points: [`artifacts`](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/tree/main/artifacts) (Model artifacts), [`app.py`](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/app.py) (Streamlit demo), [`data/processed`](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/tree/main/data/processed) (Processed datasets), [`src/inference/multihead_inference.py`](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/inference/multihead_inference.py) (MultiHead inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Synthetic data"]
  node_multi_dataset["Structured dataset"]
  node_token_data["Caption vocabulary<br/>[tokenised_data.py]"]
  node_embedding_dataset["Embedding dataset"]
  node_simple_dataset["Image-caption dataset"]
  node_generators["Dataset generators"]
  node_shapes_generator["Shapes generator<br/>[generate_shapes.py]"]
  node_board_generator["Tic-tac-toe generator"]
  node_test_data[("Processed datasets")]
end

subgraph group_learning["Model development"]
  node_multi_model["MultiHead CNN<br/>[multihead_cnn.py]"]
  node_lstm_model["CNN-LSTM<br/>[cnn_lstm.py]"]
  node_embedding_model["Embedding CNN<br/>[embedding_cnn.py]"]
  node_multi_train["MultiHead training"]
  node_lstm_train["CNN-LSTM training<br/>[train_cnn_lstm.py]"]
  node_embedding_train["Embedding training"]
  node_simple_train["Simple CNN training<br/>[simple_train.py]"]
  node_artifacts[("Model artifacts")]
end

subgraph group_serving["Demo and inference"]
  node_demo["Streamlit demo<br/>[app.py]"]
  node_input["Image and task input<br/>[app.py]"]
  node_multi_infer["MultiHead inference"]
  node_lstm_infer["CNN-LSTM inference<br/>[lstm_inference.py]"]
end

subgraph group_assessment["Evaluation"]
  node_evaluation["Evaluation results<br/>[evaluation.py]"]
end

node_user(("Demo user"))

node_user -->|"uses"| node_demo
node_demo -->|"collects"| node_input
node_demo -->|"calls"| node_multi_infer
node_demo -->|"calls"| node_lstm_infer
node_multi_infer -->|"loads and predicts"| node_multi_model
node_multi_infer -->|"reconstructs caption"| node_multi_dataset
node_lstm_infer -->|"loads and decodes"| node_lstm_model
node_lstm_infer -->|"builds vocabulary"| node_token_data
node_demo -->|"reads test samples"| node_test_data
node_generators -.->|"generates numbers"| node_test_data
node_shapes_generator -.->|"generates shapes"| node_test_data
node_board_generator -.->|"generates boards"| node_test_data
node_multi_train -->|"loads"| node_multi_dataset
node_multi_train -->|"trains"| node_multi_model
node_lstm_train -->|"loads"| node_token_data
node_lstm_train -->|"trains"| node_lstm_model
node_embedding_train -->|"loads"| node_embedding_dataset
node_embedding_train -->|"trains"| node_embedding_model
node_simple_train -->|"loads"| node_simple_dataset
node_simple_train -.->|"uses"| node_test_data
node_multi_train -.->|"saves weights"| node_artifacts
node_lstm_train -.->|"saves weights"| node_artifacts
node_embedding_train -.->|"saves weights"| node_artifacts
node_multi_infer -->|"loads weights"| node_artifacts
node_lstm_infer -->|"loads weights"| node_artifacts
node_evaluation -.->|"evaluates models"| node_artifacts

click node_demo "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/app.py"
click node_input "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/app.py"
click node_multi_infer "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/inference/multihead_inference.py"
click node_lstm_infer "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/inference/lstm_inference.py"
click node_multi_model "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/models/multihead_cnn.py"
click node_lstm_model "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/models/cnn_lstm.py"
click node_embedding_model "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/models/embedding_cnn.py"
click node_multi_dataset "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/multihead_dataset.py"
click node_token_data "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/tokenised_data.py"
click node_embedding_dataset "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/embedding_dataset.py"
click node_simple_dataset "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/simple_pipeline_dataset.py"
click node_generators "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/generate_numbers.py"
click node_shapes_generator "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/generate_shapes.py"
click node_board_generator "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/generate_tictactoe.py"
click node_multi_train "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/training/train_multihead_cnn.py"
click node_lstm_train "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/training/train_cnn_lstm.py"
click node_embedding_train "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/training/train_embedding_model.py"
click node_simple_train "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/training/simple_train.py"
click node_artifacts "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/tree/main/artifacts"
click node_evaluation "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/Evaluation/evaluation.py"
click node_test_data "https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/tree/main/data/processed"

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_multi_dataset,node_token_data,node_embedding_dataset,node_simple_dataset,node_generators,node_shapes_generator,node_board_generator,node_test_data,node_user toneBlue
class node_multi_model,node_lstm_model,node_embedding_model,node_multi_train,node_lstm_train,node_embedding_train,node_simple_train,node_artifacts toneAmber
class node_demo,node_input,node_multi_infer,node_lstm_infer toneMint
class node_evaluation toneRose
```

## Components

### Synthetic data

- [Structured dataset](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/multihead_dataset.py): `src/data/multihead_dataset.py`
- [Caption vocabulary](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/tokenised_data.py): `src/data/tokenised_data.py`
- [Embedding dataset](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/embedding_dataset.py): `src/data/embedding_dataset.py`
- [Image-caption dataset](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/simple_pipeline_dataset.py): `src/data/simple_pipeline_dataset.py`
- [Dataset generators](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/generate_numbers.py): `src/data/generate_numbers.py`
- [Shapes generator](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/generate_shapes.py): `src/data/generate_shapes.py`
- [Tic-tac-toe generator](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/data/generate_tictactoe.py): `src/data/generate_tictactoe.py`
- [Processed datasets](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/tree/main/data/processed): `data/processed`

### Model development

- [MultiHead CNN](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/models/multihead_cnn.py): `src/models/multihead_cnn.py`
- [CNN-LSTM](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/models/cnn_lstm.py): `src/models/cnn_lstm.py`
- [Embedding CNN](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/models/embedding_cnn.py): `src/models/embedding_cnn.py`
- [MultiHead training](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/training/train_multihead_cnn.py): `src/training/train_multihead_cnn.py`
- [CNN-LSTM training](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/training/train_cnn_lstm.py): `src/training/train_cnn_lstm.py`
- [Embedding training](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/training/train_embedding_model.py): `src/training/train_embedding_model.py`
- [Simple CNN training](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/training/simple_train.py): `src/training/simple_train.py`
- [Model artifacts](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/tree/main/artifacts): `artifacts`

### Demo and inference

- [Streamlit demo](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/app.py): `app.py`
- [Image and task input](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/app.py): `app.py`
- [MultiHead inference](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/inference/multihead_inference.py): `src/inference/multihead_inference.py`
- [CNN-LSTM inference](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/src/inference/lstm_inference.py): `src/inference/lstm_inference.py`

### Evaluation

- [Evaluation results](https://github.com/ishaan-bhalla/neural-network-to-describe-simple-pictures-group-40/blob/main/Evaluation/evaluation.py): `Evaluation/evaluation.py`

### Other components

- **Demo user**

## Connections

- Demo user → Streamlit demo: uses (evidence: `README.md`)
- Streamlit demo → Image and task input: collects (evidence: `app.py`)
- Streamlit demo → MultiHead inference: calls (evidence: `app.py`)
- Streamlit demo → CNN-LSTM inference: calls (evidence: `app.py`)
- MultiHead inference → MultiHead CNN: loads and predicts (evidence: `src/inference/multihead_inference.py`)
- MultiHead inference → Structured dataset: reconstructs caption (evidence: `src/inference/multihead_inference.py`)
- CNN-LSTM inference → CNN-LSTM: loads and decodes (evidence: `src/inference/lstm_inference.py`)
- CNN-LSTM inference → Caption vocabulary: builds vocabulary (evidence: `src/inference/lstm_inference.py`)
- Streamlit demo → Processed datasets: reads test samples (evidence: `app.py`)
- Dataset generators → Processed datasets: generates numbers (evidence: `README.md`)
- Shapes generator → Processed datasets: generates shapes (evidence: `README.md`)
- Tic-tac-toe generator → Processed datasets: generates boards (evidence: `README.md`)
- MultiHead training → Structured dataset: loads (evidence: `src/training/train_multihead_cnn.py`)
- MultiHead training → MultiHead CNN: trains (evidence: `src/training/train_multihead_cnn.py`)
- CNN-LSTM training → Caption vocabulary: loads (evidence: `src/training/train_cnn_lstm.py`)
- CNN-LSTM training → CNN-LSTM: trains (evidence: `src/training/train_cnn_lstm.py`)
- Embedding training → Embedding dataset: loads (evidence: `src/training/train_embedding_model.py`)
- Embedding training → Embedding CNN: trains (evidence: `src/training/train_embedding_model.py`)
- Simple CNN training → Image-caption dataset: loads (evidence: `src/training/simple_train.py`)
- Simple CNN training → Processed datasets: uses
- MultiHead training → Model artifacts: saves weights (evidence: `README.md`)
- CNN-LSTM training → Model artifacts: saves weights (evidence: `README.md`)
- Embedding training → Model artifacts: saves weights (evidence: `README.md`)
- MultiHead inference → Model artifacts: loads weights (evidence: `src/inference/multihead_inference.py`)
- CNN-LSTM inference → Model artifacts: loads weights (evidence: `src/inference/lstm_inference.py`)
- Evaluation results → Model artifacts: evaluates models (evidence: `README.md`)
