# fakebaconpancakes/reat---trial architecture

> Architecture diagram of the GitHub repository fakebaconpancakes/reat---trial, 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/fakebaconpancakes/reat---trial
- Repository: https://github.com/fakebaconpancakes/reat---trial

## Overview

This repository implements NTU RGB+D skeleton-based human-action recognition, model training, inference, and explainability evaluation. The main workflow prepares skeleton data, converts each sample into geometric and motion features, trains a spatial-GCN/temporal-attention classifier, then evaluates predictions and generates joint-level explanations. Separate proving engines assess explanation faithfulness and semantic alignment. The README is empty, and several central scripts were not sampled; their components are shown where supported by the tree, but uncertain wiring is omitted.

Main entry points: [`batch_processor.py`](https://github.com/fakebaconpancakes/reat---trial/blob/main/batch_processor.py) (Batch inference), [`utils/dataset.py`](https://github.com/fakebaconpancakes/reat---trial/blob/main/utils/dataset.py) (Dataset features), [`proving_engine_fidelity.py`](https://github.com/fakebaconpancakes/reat---trial/blob/main/proving_engine_fidelity.py) (Faithfulness test), [`train.py`](https://github.com/fakebaconpancakes/reat---trial/blob/main/train.py) (Model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Skeleton data"]
  node_preprocess["Data preprocessing<br/>[preprocess_data.py]"]
  node_split["Data splitting<br/>[data_splitter.py]"]
  node_dataset["Dataset features<br/>[dataset.py]"]
end

subgraph group_model["Recognition model"]
  node_trainer["Model training<br/>[train.py]"]
  node_gcn["Spatial GCN<br/>[spatial_gcn.py]"]
  node_temporal["Temporal attention<br/>[temporal_brain.py]"]
  node_weights["Model weights"]
end

subgraph group_explain["Explainability"]
  node_batch["Batch inference<br/>[batch_processor.py]"]
  node_xai["Heatmap scaling<br/>[xai_extractor.py]"]
  node_heatmaps["Joint heatmaps"]
  node_gifs["XAI visualizations"]
end

subgraph group_analysis["Evaluation"]
  node_evaluator["Model evaluation<br/>[evaluate.py]"]
  node_fidelity["Faithfulness test"]
  node_semantic["Semantic test"]
  node_metrics["Evaluation metrics"]
end

node_raw["Skeleton files"]

node_raw -->|"processes"| node_preprocess
node_preprocess -->|"prepares data"| node_dataset
node_dataset -->|"provides batches"| node_trainer
node_trainer -->|"invokes"| node_gcn
node_trainer -->|"invokes"| node_temporal
node_trainer -->|"saves"| node_weights
node_dataset -->|"provides data"| node_evaluator
node_weights -->|"loads"| node_evaluator
node_dataset -->|"provides samples"| node_batch
node_batch -->|"invokes"| node_gcn
node_batch -->|"invokes"| node_temporal
node_batch -->|"loads"| node_weights
node_batch -->|"normalizes heatmaps"| node_xai
node_batch -->|"writes"| node_heatmaps
node_batch -->|"renders"| node_gifs
node_dataset -->|"provides samples"| node_fidelity
node_heatmaps -->|"reads"| node_fidelity
node_fidelity -->|"invokes"| node_gcn
node_fidelity -->|"invokes"| node_temporal
node_fidelity -->|"loads"| node_weights
node_fidelity -->|"writes"| node_metrics
node_dataset -->|"provides labels"| node_semantic
node_heatmaps -->|"reads"| node_semantic
node_semantic -->|"writes"| node_metrics

click node_preprocess "https://github.com/fakebaconpancakes/reat---trial/blob/main/preprocess_data.py"
click node_split "https://github.com/fakebaconpancakes/reat---trial/blob/main/data_splitter.py"
click node_dataset "https://github.com/fakebaconpancakes/reat---trial/blob/main/utils/dataset.py"
click node_trainer "https://github.com/fakebaconpancakes/reat---trial/blob/main/train.py"
click node_gcn "https://github.com/fakebaconpancakes/reat---trial/blob/main/models/spatial_gcn.py"
click node_temporal "https://github.com/fakebaconpancakes/reat---trial/blob/main/models/temporal_brain.py"
click node_evaluator "https://github.com/fakebaconpancakes/reat---trial/blob/main/evaluate.py"
click node_batch "https://github.com/fakebaconpancakes/reat---trial/blob/main/batch_processor.py"
click node_xai "https://github.com/fakebaconpancakes/reat---trial/blob/main/utils/xai_extractor.py"
click node_gifs "https://github.com/fakebaconpancakes/reat---trial/blob/main/visualization_gif.py"
click node_fidelity "https://github.com/fakebaconpancakes/reat---trial/blob/main/proving_engine_fidelity.py"
click node_semantic "https://github.com/fakebaconpancakes/reat---trial/blob/main/proving_engine_semantic.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_preprocess,node_split,node_dataset toneBlue
class node_trainer,node_gcn,node_temporal,node_weights toneAmber
class node_batch,node_xai,node_heatmaps,node_gifs toneMint
class node_evaluator,node_fidelity,node_semantic,node_metrics toneRose
class node_raw toneIndigo
```

## Components

### Skeleton data

- [Data preprocessing](https://github.com/fakebaconpancakes/reat---trial/blob/main/preprocess_data.py): `preprocess_data.py`
- [Data splitting](https://github.com/fakebaconpancakes/reat---trial/blob/main/data_splitter.py): `data_splitter.py`
- [Dataset features](https://github.com/fakebaconpancakes/reat---trial/blob/main/utils/dataset.py): `utils/dataset.py`

### Recognition model

- [Model training](https://github.com/fakebaconpancakes/reat---trial/blob/main/train.py): `train.py`
- [Spatial GCN](https://github.com/fakebaconpancakes/reat---trial/blob/main/models/spatial_gcn.py): `models/spatial_gcn.py`
- [Temporal attention](https://github.com/fakebaconpancakes/reat---trial/blob/main/models/temporal_brain.py): `models/temporal_brain.py`
- **Model weights**

### Explainability

- [Batch inference](https://github.com/fakebaconpancakes/reat---trial/blob/main/batch_processor.py): `batch_processor.py`
- [Heatmap scaling](https://github.com/fakebaconpancakes/reat---trial/blob/main/utils/xai_extractor.py): `utils/xai_extractor.py`
- **Joint heatmaps**
- [XAI visualizations](https://github.com/fakebaconpancakes/reat---trial/blob/main/visualization_gif.py): `visualization_gif.py`

### Evaluation

- [Model evaluation](https://github.com/fakebaconpancakes/reat---trial/blob/main/evaluate.py): `evaluate.py`
- [Faithfulness test](https://github.com/fakebaconpancakes/reat---trial/blob/main/proving_engine_fidelity.py): `proving_engine_fidelity.py`
- [Semantic test](https://github.com/fakebaconpancakes/reat---trial/blob/main/proving_engine_semantic.py): `proving_engine_semantic.py`
- **Evaluation metrics**

### Other components

- **Skeleton files**

## Connections

- Skeleton files → Data preprocessing: processes
- Data preprocessing → Dataset features: prepares data
- Dataset features → Model training: provides batches
- Model training → Spatial GCN: invokes
- Model training → Temporal attention: invokes
- Model training → Model weights: saves
- Dataset features → Model evaluation: provides data
- Model weights → Model evaluation: loads
- Dataset features → Batch inference: provides samples
- Batch inference → Spatial GCN: invokes
- Batch inference → Temporal attention: invokes
- Batch inference → Model weights: loads
- Batch inference → Heatmap scaling: normalizes heatmaps
- Batch inference → Joint heatmaps: writes
- Batch inference → XAI visualizations: renders
- Dataset features → Faithfulness test: provides samples
- Joint heatmaps → Faithfulness test: reads
- Faithfulness test → Spatial GCN: invokes
- Faithfulness test → Temporal attention: invokes
- Faithfulness test → Model weights: loads
- Faithfulness test → Evaluation metrics: writes
- Dataset features → Semantic test: provides labels
- Joint heatmaps → Semantic test: reads
- Semantic test → Evaluation metrics: writes
