# gasimmammad/cuttings-lithology-ml architecture

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

- Interactive diagram: https://gitdiagram.com/gasimmammad/cuttings-lithology-ml
- Repository: https://github.com/gasimmammad/cuttings-lithology-ml

## Overview

This repository is a research pipeline for testing what drill-cuttings photographs can reveal about lithology, chemistry, mud-log descriptions, and stratigraphy. The main documented workflow indexes photographs, creates image tiles and embeddings, computes features, then evaluates held-out-well predictions against XRF chemistry. Separate rounds investigate sand/clay classification, glauconite, mud-log labels, and stratigraphic tops. The map follows README-stated capabilities and reproduction steps; most numbered scripts were not sampled, so their internal calls and data handoffs are not inferred.

Main entry points: [`scripts/52_v7_photo_to_xrf.py`](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/52_v7_photo_to_xrf.py) (Photo to XRF), [`scripts/config.py`](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/config.py) (Paths and parameters), [`scripts/25_v2_index.py`](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/25_v2_index.py) (V2 image index), [`scripts/26_v2_tiles.py`](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/26_v2_tiles.py) (Image tiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and configuration"]
  node_well_data[("Released well data")]
  node_config["Paths and parameters<br/>[config.py]"]
end

subgraph group_image["Image preparation and models"]
  node_inventory["Photo inventory<br/>[01_inventory.py]"]
  node_v2_index["V2 image index<br/>[25_v2_index.py]"]
  node_tiles["Image tiles<br/>[26_v2_tiles.py]"]
  node_embeddings["Image embeddings<br/>[27_v2_embed.py]"]
  node_features["Colour and texture features<br/>[features.py]"]
end

subgraph group_research["Research tests"]
  node_labels["Gamma-ray labels<br/>[03_make_labels.py]"]
  node_classifier["Sand-clay evaluation<br/>[29_v2_evaluate.py]"]
  node_xrf["Photo to XRF"]
  node_elements["Element and skill tests"]
  node_mudlog["Mud-log label tests"]
  node_mudlog_eval["Mud-log evaluation"]
  node_pellet["Glauconite detector"]
  node_stratigraphy["Stratigraphic tests<br/>[70_v10_strat.py]"]
  node_step_response["Vertical-resolution test<br/>[71_v10_step.py]"]
end

subgraph group_outputs["Evaluation and reporting"]
  node_reports["Results and figures<br/>[65_v8_figures.py]"]
end

node_analyst(("Researcher"))

node_well_data -->|"indexes photos"| node_v2_index
node_v2_index -->|"prepares images"| node_tiles
node_tiles -->|"creates embeddings"| node_embeddings
node_embeddings -->|"extracts features"| node_features
node_features -->|"predicts chemistry"| node_xrf
node_xrf -->|"extends tests"| node_elements
node_elements -->|"visualizes results"| node_reports
node_well_data -.->|"provides well logs"| node_labels
node_labels -.->|"tests labels"| node_classifier
node_well_data -.->|"provides mud logs"| node_mudlog
node_mudlog -.->|"evaluates labels"| node_mudlog_eval
node_well_data -.->|"provides photographs"| node_pellet
node_well_data -.->|"provides well data"| node_stratigraphy
node_well_data -.->|"provides well data"| node_step_response
node_analyst -.->|"reviews findings"| node_reports
node_config -->|"configures paths"| node_inventory
node_config -->|"configures paths"| node_xrf

click node_config "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/config.py"
click node_inventory "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/01_inventory.py"
click node_v2_index "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/25_v2_index.py"
click node_tiles "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/26_v2_tiles.py"
click node_embeddings "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/27_v2_embed.py"
click node_features "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/features.py"
click node_labels "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/03_make_labels.py"
click node_classifier "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/29_v2_evaluate.py"
click node_xrf "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/52_v7_photo_to_xrf.py"
click node_elements "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/63_v8_elements_when.py"
click node_mudlog "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/57_v7_mudlog_labels.py"
click node_mudlog_eval "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/58_v7_mudlog_tests.py"
click node_pellet "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/53_v7_pellet_blobs.py"
click node_stratigraphy "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/70_v10_strat.py"
click node_step_response "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/71_v10_step.py"
click node_reports "https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/65_v8_figures.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_well_data,node_config toneBlue
class node_inventory,node_v2_index,node_tiles,node_embeddings,node_features toneAmber
class node_labels,node_classifier,node_xrf,node_elements,node_mudlog,node_mudlog_eval,node_pellet,node_stratigraphy,node_step_response toneMint
class node_reports toneRose
class node_analyst toneIndigo
```

## Components

### Inputs and configuration

- **Released well data**
- [Paths and parameters](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/config.py): `scripts/config.py`

### Image preparation and models

- [Photo inventory](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/01_inventory.py): `scripts/01_inventory.py`
- [V2 image index](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/25_v2_index.py): `scripts/25_v2_index.py`
- [Image tiles](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/26_v2_tiles.py): `scripts/26_v2_tiles.py`
- [Image embeddings](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/27_v2_embed.py): `scripts/27_v2_embed.py`
- [Colour and texture features](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/features.py): `scripts/features.py`

### Research tests

- [Gamma-ray labels](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/03_make_labels.py): `scripts/03_make_labels.py`
- [Sand-clay evaluation](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/29_v2_evaluate.py): `scripts/29_v2_evaluate.py`
- [Photo to XRF](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/52_v7_photo_to_xrf.py): `scripts/52_v7_photo_to_xrf.py`
- [Element and skill tests](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/63_v8_elements_when.py): `scripts/63_v8_elements_when.py`
- [Mud-log label tests](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/57_v7_mudlog_labels.py): `scripts/57_v7_mudlog_labels.py`
- [Mud-log evaluation](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/58_v7_mudlog_tests.py): `scripts/58_v7_mudlog_tests.py`
- [Glauconite detector](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/53_v7_pellet_blobs.py): `scripts/53_v7_pellet_blobs.py`
- [Stratigraphic tests](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/70_v10_strat.py): `scripts/70_v10_strat.py`
- [Vertical-resolution test](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/71_v10_step.py): `scripts/71_v10_step.py`

### Evaluation and reporting

- [Results and figures](https://github.com/gasimmammad/cuttings-lithology-ml/blob/main/scripts/65_v8_figures.py): `scripts/65_v8_figures.py`

### Other components

- **Researcher**

## Connections

- Released well data → V2 image index: indexes photos (evidence: `README.md`)
- V2 image index → Image tiles: prepares images (evidence: `README.md`)
- Image tiles → Image embeddings: creates embeddings (evidence: `README.md`)
- Image embeddings → Colour and texture features: extracts features (evidence: `README.md`)
- Colour and texture features → Photo to XRF: predicts chemistry (evidence: `README.md`)
- Photo to XRF → Element and skill tests: extends tests (evidence: `README.md`)
- Element and skill tests → Results and figures: visualizes results (evidence: `README.md`)
- Released well data → Gamma-ray labels: provides well logs
- Gamma-ray labels → Sand-clay evaluation: tests labels
- Released well data → Mud-log label tests: provides mud logs
- Mud-log label tests → Mud-log evaluation: evaluates labels
- Released well data → Glauconite detector: provides photographs
- Released well data → Stratigraphic tests: provides well data
- Released well data → Vertical-resolution test: provides well data
- Researcher → Results and figures: reviews findings
- Paths and parameters → Photo inventory: configures paths (evidence: `README.md`)
- Paths and parameters → Photo to XRF: configures paths (evidence: `README.md`)
