# ayodeji63/multiclass_model_ architecture

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

- Interactive diagram: https://gitdiagram.com/ayodeji63/multiclass_model_
- Repository: https://github.com/ayodeji63/multiclass_model_

## Overview

This MATLAB project is an end-to-end electricity-theft research workflow: load SGCC or synthetic data, prepare and split it, train a multi-class CNN-BiLSTM with dual attention, then assess and explain its results. The README documents the main stages and optional analyses, but no source excerpts were provided, so internal call wiring is shown only where the documentation supports it; in particular, the diagram treats main.m as the workflow orchestrator rather than asserting unverified helper calls.

Main entry points: [`main.m`](https://github.com/ayodeji63/multiclass_model_/blob/main/main.m) (Run workflow), [`preprocessing/preprocess_pipeline.m`](https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/preprocess_pipeline.m) (Preprocess data), [`data/load_sgcc_dataset.m`](https://github.com/ayodeji63/multiclass_model_/blob/main/data/load_sgcc_dataset.m) (Load SGCC), [`data/generate_synthetic_sgcc_data.m`](https://github.com/ayodeji63/multiclass_model_/blob/main/data/generate_synthetic_sgcc_data.m) (Generate synthetic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_loader["Load SGCC"]
  node_synthetic["Generate synthetic"]
  node_preprocess["Preprocess data"]
  node_quality["Filter consumers"]
  node_inject["Inject theft types"]
  node_features["Compute signatures"]
  node_splits["Create data splits<br/>[data_splits.m]"]
  node_smote["Balance classes<br/>[apply_smote.m]"]
end

subgraph group_model["Modeling"]
  node_proposed["Proposed model<br/>[proposed_model.m]"]
  node_baselines["Baseline models<br/>[baseline_models.m]"]
  node_train["Train deep model<br/>[train_deep_model.m]"]
  node_hpo["Tune hyperparameters"]
end

subgraph group_assessment["Assessment"]
  node_metrics["Binary benchmark"]
  node_comparative["Comparative study"]
  node_kfold["Stratified CV"]
  node_temporal["Temporal validation"]
end

subgraph group_interpretation["Interpretation"]
  node_shap["SHAP analysis"]
  node_attention["Attention maps"]
  node_figures["Generate figures"]
end

node_user(("Researcher"))
node_main["Run workflow<br/>[main.m]"]

node_user -->|"runs"| node_main
node_main -->|"loads data"| node_loader
node_loader -.->|"falls back"| node_synthetic
node_main -->|"runs preprocessing"| node_preprocess
node_main -->|"creates splits"| node_splits
node_main -->|"balances classes"| node_smote
node_main -->|"selects model"| node_proposed
node_main -->|"trains model"| node_train
node_main -.->|"optionally tunes"| node_hpo
node_main -->|"benchmarks holdout"| node_metrics
node_main -->|"runs comparison"| node_comparative
node_main -->|"runs cross-validation"| node_kfold
node_main -->|"validates temporally"| node_temporal
node_main -->|"explains predictions"| node_shap
node_main -->|"maps attention"| node_attention
node_main -->|"generates figures"| node_figures
node_preprocess -->|"filters consumers"| node_quality
node_preprocess -->|"creates classes"| node_inject
node_preprocess -->|"computes features"| node_features
node_main -->|"uses baselines"| node_baselines

click node_main "https://github.com/ayodeji63/multiclass_model_/blob/main/main.m"
click node_loader "https://github.com/ayodeji63/multiclass_model_/blob/main/data/load_sgcc_dataset.m"
click node_synthetic "https://github.com/ayodeji63/multiclass_model_/blob/main/data/generate_synthetic_sgcc_data.m"
click node_preprocess "https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/preprocess_pipeline.m"
click node_quality "https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/filter_low_quality_consumers.m"
click node_inject "https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/inject_multiclass_theft_signatures.m"
click node_features "https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/compute_signature_features.m"
click node_splits "https://github.com/ayodeji63/multiclass_model_/blob/main/splitting/data_splits.m"
click node_smote "https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/apply_smote.m"
click node_proposed "https://github.com/ayodeji63/multiclass_model_/blob/main/models/proposed_model.m"
click node_baselines "https://github.com/ayodeji63/multiclass_model_/blob/main/models/baseline_models.m"
click node_train "https://github.com/ayodeji63/multiclass_model_/blob/main/training/train_deep_model.m"
click node_hpo "https://github.com/ayodeji63/multiclass_model_/blob/main/optimization/run_hyperparameter_search.m"
click node_metrics "https://github.com/ayodeji63/multiclass_model_/blob/main/evaluation/run_binary_holdout_benchmark.m"
click node_comparative "https://github.com/ayodeji63/multiclass_model_/blob/main/evaluation/run_comparative_and_ablation_study.m"
click node_kfold "https://github.com/ayodeji63/multiclass_model_/blob/main/evaluation/run_stratified_kfold.m"
click node_temporal "https://github.com/ayodeji63/multiclass_model_/blob/main/evaluation/run_temporal_split_validation.m"
click node_shap "https://github.com/ayodeji63/multiclass_model_/blob/main/explainability/run_shap_analysis.m"
click node_attention "https://github.com/ayodeji63/multiclass_model_/blob/main/explainability/temporal_attention_map.m"
click node_figures "https://github.com/ayodeji63/multiclass_model_/blob/main/visualization/generate_all_figures.m"

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_loader,node_synthetic,node_preprocess,node_quality,node_inject,node_features,node_splits,node_smote toneBlue
class node_proposed,node_baselines,node_train,node_hpo toneAmber
class node_metrics,node_comparative,node_kfold,node_temporal toneMint
class node_shap,node_attention,node_figures toneRose
class node_user toneIndigo
class node_main toneTeal
```

## Components

### Data preparation

- [Load SGCC](https://github.com/ayodeji63/multiclass_model_/blob/main/data/load_sgcc_dataset.m): `data/load_sgcc_dataset.m`
- [Generate synthetic](https://github.com/ayodeji63/multiclass_model_/blob/main/data/generate_synthetic_sgcc_data.m): `data/generate_synthetic_sgcc_data.m`
- [Preprocess data](https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/preprocess_pipeline.m): `preprocessing/preprocess_pipeline.m`
- [Filter consumers](https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/filter_low_quality_consumers.m): `preprocessing/filter_low_quality_consumers.m`
- [Inject theft types](https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/inject_multiclass_theft_signatures.m): `preprocessing/inject_multiclass_theft_signatures.m`
- [Compute signatures](https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/compute_signature_features.m): `preprocessing/compute_signature_features.m`
- [Create data splits](https://github.com/ayodeji63/multiclass_model_/blob/main/splitting/data_splits.m): `splitting/data_splits.m`
- [Balance classes](https://github.com/ayodeji63/multiclass_model_/blob/main/preprocessing/apply_smote.m): `preprocessing/apply_smote.m`

### Modeling

- [Proposed model](https://github.com/ayodeji63/multiclass_model_/blob/main/models/proposed_model.m): `models/proposed_model.m`
- [Baseline models](https://github.com/ayodeji63/multiclass_model_/blob/main/models/baseline_models.m): `models/baseline_models.m`
- [Train deep model](https://github.com/ayodeji63/multiclass_model_/blob/main/training/train_deep_model.m): `training/train_deep_model.m`
- [Tune hyperparameters](https://github.com/ayodeji63/multiclass_model_/blob/main/optimization/run_hyperparameter_search.m): `optimization/run_hyperparameter_search.m`

### Assessment

- [Binary benchmark](https://github.com/ayodeji63/multiclass_model_/blob/main/evaluation/run_binary_holdout_benchmark.m): `evaluation/run_binary_holdout_benchmark.m`
- [Comparative study](https://github.com/ayodeji63/multiclass_model_/blob/main/evaluation/run_comparative_and_ablation_study.m): `evaluation/run_comparative_and_ablation_study.m`
- [Stratified CV](https://github.com/ayodeji63/multiclass_model_/blob/main/evaluation/run_stratified_kfold.m): `evaluation/run_stratified_kfold.m`
- [Temporal validation](https://github.com/ayodeji63/multiclass_model_/blob/main/evaluation/run_temporal_split_validation.m): `evaluation/run_temporal_split_validation.m`

### Interpretation

- [SHAP analysis](https://github.com/ayodeji63/multiclass_model_/blob/main/explainability/run_shap_analysis.m): `explainability/run_shap_analysis.m`
- [Attention maps](https://github.com/ayodeji63/multiclass_model_/blob/main/explainability/temporal_attention_map.m): `explainability/temporal_attention_map.m`
- [Generate figures](https://github.com/ayodeji63/multiclass_model_/blob/main/visualization/generate_all_figures.m): `visualization/generate_all_figures.m`

### Other components

- **Researcher**
- [Run workflow](https://github.com/ayodeji63/multiclass_model_/blob/main/main.m): `main.m`

## Connections

- Researcher → Run workflow: runs
- Run workflow → Load SGCC: loads data
- Load SGCC → Generate synthetic: falls back
- Run workflow → Preprocess data: runs preprocessing
- Run workflow → Create data splits: creates splits
- Run workflow → Balance classes: balances classes
- Run workflow → Proposed model: selects model
- Run workflow → Train deep model: trains model
- Run workflow → Tune hyperparameters: optionally tunes
- Run workflow → Binary benchmark: benchmarks holdout
- Run workflow → Comparative study: runs comparison
- Run workflow → Stratified CV: runs cross-validation
- Run workflow → Temporal validation: validates temporally
- Run workflow → SHAP analysis: explains predictions
- Run workflow → Attention maps: maps attention
- Run workflow → Generate figures: generates figures
- Preprocess data → Filter consumers: filters consumers
- Preprocess data → Inject theft types: creates classes
- Preprocess data → Compute signatures: computes features
- Run workflow → Baseline models: uses baselines
