# syedaliasghar14/cnn-for-asi architecture

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

- Interactive diagram: https://gitdiagram.com/syedaliasghar14/cnn-for-asi
- Repository: https://github.com/syedaliasghar14/cnn-for-asi

## Overview

This is a PyTorch seismic-interpretation application: it trains a 3D CNN from SEG-Y seismic volumes and colored slice labels, then applies the trained model to slices or a full cube and can extract learned features. The principal workflow runs from seismic and label inputs through augmented training batches, model optimization and saved weights to prediction and SEG-Y output. TensorBoard visualization is an additional capability. Prediction entry-point implementations were not sampled, so their internal wiring is shown only where README documentation supports it.

Main entry points: [`train.py`](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/train.py) (Training loop), [`utils.py`](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/utils.py) (Slice and cube inference), [`test.py`](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/test.py) (Prediction example), [`data.py`](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/data.py) (SEG-Y and labels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Seismic inputs"]
  node_data["SEG-Y and labels<br/>[data.py]"]
  node_cube[("Seismic cube")]
  node_coordinates["Label coordinates"]
  node_writer["SEG-Y writer<br/>[data.py]"]
end

subgraph group_learning["Model training"]
  node_batch["Augmented batches<br/>[batch.py]"]
  node_train["Training loop<br/>[train.py]"]
  node_network["3D TextureNet<br/>[texture_net.py]"]
  node_weights["Saved weights"]
end

subgraph group_prediction["Interpretation"]
  node_test["Prediction example<br/>[test.py]"]
  node_parallel["Multi-GPU prediction<br/>[test_parallel.py]"]
  node_interpret["Slice and cube inference<br/>[utils.py]"]
  node_features["Feature extraction<br/>[texture_net.py]"]
end

subgraph group_observability["Visualization"]
  node_logger["TensorBoard logger<br/>[tb_logger.py]"]
end

node_user(("Researcher"))
node_segy["Seismic SEG-Y"]
node_labels["Label images"]
node_output["Interpretation SEG-Y"]
node_tensorboard(("TensorBoard"))

node_user -->|"provides data"| node_segy
node_user -->|"provides labels"| node_labels
node_segy -->|"loads"| node_data
node_labels -->|"loads"| node_data
node_data -->|"returns cube"| node_cube
node_data -->|"returns coordinates"| node_coordinates
node_cube -->|"samples"| node_batch
node_coordinates -->|"selects centers"| node_batch
node_batch -->|"supplies batches"| node_train
node_train -->|"trains"| node_network
node_train -->|"calls inference"| node_interpret
node_train -->|"saves weights"| node_weights
node_user -->|"runs prediction"| node_test
node_user -.->|"runs prediction"| node_parallel
node_test -->|"predicts slices/cube"| node_interpret
node_parallel -.->|"predicts in parallel"| node_interpret
node_test -->|"extracts features"| node_features
node_interpret -->|"evaluates"| node_network
node_test -->|"loads weights"| node_weights
node_parallel -.->|"loads weights"| node_weights
node_interpret -->|"produces interpretation"| node_writer
node_writer -->|"writes"| node_output
node_train -->|"logs progress"| node_logger
node_logger -->|"writes summaries"| node_tensorboard

click node_data "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/data.py"
click node_batch "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/batch.py"
click node_train "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/train.py"
click node_network "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/texture_net.py"
click node_test "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/test.py"
click node_parallel "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/test_parallel.py"
click node_interpret "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/utils.py"
click node_features "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/texture_net.py"
click node_writer "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/data.py"
click node_logger "https://github.com/syedaliasghar14/cnn-for-asi/blob/master/tb_logger.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_data,node_cube,node_coordinates,node_writer toneBlue
class node_batch,node_train,node_network,node_weights toneAmber
class node_test,node_parallel,node_interpret,node_features toneMint
class node_logger toneRose
class node_user,node_segy,node_labels,node_output,node_tensorboard toneIndigo
```

## Components

### Seismic inputs

- [SEG-Y and labels](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/data.py): `data.py`
- **Seismic cube**
- **Label coordinates**
- [SEG-Y writer](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/data.py): `data.py`

### Model training

- [Augmented batches](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/batch.py): `batch.py`
- [Training loop](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/train.py): `train.py`
- [3D TextureNet](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/texture_net.py): `texture_net.py`
- **Saved weights**

### Interpretation

- [Prediction example](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/test.py): `test.py`
- [Multi-GPU prediction](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/test_parallel.py): `test_parallel.py`
- [Slice and cube inference](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/utils.py): `utils.py`
- [Feature extraction](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/texture_net.py): `texture_net.py`

### Visualization

- [TensorBoard logger](https://github.com/syedaliasghar14/cnn-for-asi/blob/master/tb_logger.py): `tb_logger.py`

### Other components

- **Researcher**
- **Seismic SEG-Y**
- **Label images**
- **Interpretation SEG-Y**
- **TensorBoard**

## Connections

- Researcher → Seismic SEG-Y: provides data
- Researcher → Label images: provides labels
- Seismic SEG-Y → SEG-Y and labels: loads
- Label images → SEG-Y and labels: loads
- SEG-Y and labels → Seismic cube: returns cube
- SEG-Y and labels → Label coordinates: returns coordinates
- Seismic cube → Augmented batches: samples
- Label coordinates → Augmented batches: selects centers
- Augmented batches → Training loop: supplies batches
- Training loop → 3D TextureNet: trains
- Training loop → Slice and cube inference: calls inference
- Training loop → Saved weights: saves weights
- Researcher → Prediction example: runs prediction
- Researcher → Multi-GPU prediction: runs prediction
- Prediction example → Slice and cube inference: predicts slices/cube
- Multi-GPU prediction → Slice and cube inference: predicts in parallel
- Prediction example → Feature extraction: extracts features
- Slice and cube inference → 3D TextureNet: evaluates
- Prediction example → Saved weights: loads weights
- Multi-GPU prediction → Saved weights: loads weights
- Slice and cube inference → SEG-Y writer: produces interpretation
- SEG-Y writer → Interpretation SEG-Y: writes
- Training loop → TensorBoard logger: logs progress
- TensorBoard logger → TensorBoard: writes summaries
