# juiyya/cnn-gs-mlp architecture

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

- Interactive diagram: https://gitdiagram.com/juiyya/cnn-gs-mlp
- Repository: https://github.com/juiyya/cnn-gs-mlp

## Overview

This repository delivers a Streamlit app that classifies an already-recorded or hypothetical São Paulo cellphone-theft occurrence as robbery or theft. The user supplies four contextual attributes; the app transforms them with the saved preprocessor, runs the selected MLP, and displays the class and both probabilities. The notebook documents the broader data preparation, model comparison, and evaluation workflow that produced the deployed artifacts. Training-stage links are based on README descriptions; the notebook contents were not sampled.

Main entry points: [`app.py`](https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py) (Input and results UI), [`GS_Classificacao_Roubo_vs_Furto.ipynb`](https://github.com/juiyya/cnn-gs-mlp/blob/main/GS_Classificacao_Roubo_vs_Furto.ipynb) (Data preparation), [`preprocess.joblib`](https://github.com/juiyya/cnn-gs-mlp/blob/main/preprocess.joblib) (Saved preprocessor), [`mlp_sp.keras`](https://github.com/juiyya/cnn-gs-mlp/blob/main/mlp_sp.keras) (Selected MLP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Classification app"]
  node_interface["Input and results UI<br/>[app.py]"]
  node_features["Occurrence features<br/>[app.py]"]
  node_transform["Feature transformation<br/>[app.py]"]
  node_inference["MLP inference<br/>[app.py]"]
  node_display["Class and probabilities<br/>[app.py]"]
end

subgraph group_training["Model development"]
  node_preparation["Data preparation"]
  node_encoding["Train-only preprocessing"]
  node_experiments["MLP comparison and training"]
  node_evaluation["Validation and test evaluation"]
end

subgraph group_artifacts["Deployed artifacts"]
  node_dataset[("Prepared records")]
  node_preprocessor["Saved preprocessor<br/>[preprocess.joblib]"]
  node_model["Selected MLP<br/>[mlp_sp.keras]"]
end

node_user(("User"))
node_ssp[("SSP-SP records")]

node_user -->|"enters attributes"| node_interface
node_interface -->|"collects inputs"| node_features
node_interface -->|"transforms inputs"| node_transform
node_preprocessor -->|"provides transform"| node_transform
node_interface -->|"predicts"| node_inference
node_model -->|"provides model"| node_inference
node_inference -->|"returns probabilities"| node_display
node_display -->|"shows result"| node_user
node_ssp -->|"supplies records"| node_preparation
node_preparation -.->|"prepares records"| node_dataset
node_preparation -->|"prepares features"| node_encoding
node_encoding -->|"feeds training"| node_experiments
node_experiments -->|"evaluates models"| node_evaluation
node_experiments -->|"saves selected model"| node_model
node_encoding -->|"saves transforms"| node_preprocessor

click node_interface "https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py"
click node_features "https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py"
click node_transform "https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py"
click node_inference "https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py"
click node_display "https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py"
click node_preparation "https://github.com/juiyya/cnn-gs-mlp/blob/main/GS_Classificacao_Roubo_vs_Furto.ipynb"
click node_encoding "https://github.com/juiyya/cnn-gs-mlp/blob/main/GS_Classificacao_Roubo_vs_Furto.ipynb"
click node_experiments "https://github.com/juiyya/cnn-gs-mlp/blob/main/GS_Classificacao_Roubo_vs_Furto.ipynb"
click node_evaluation "https://github.com/juiyya/cnn-gs-mlp/blob/main/GS_Classificacao_Roubo_vs_Furto.ipynb"
click node_dataset "https://github.com/juiyya/cnn-gs-mlp/blob/main/celular_2024.parquet"
click node_preprocessor "https://github.com/juiyya/cnn-gs-mlp/blob/main/preprocess.joblib"
click node_model "https://github.com/juiyya/cnn-gs-mlp/blob/main/mlp_sp.keras"

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_interface,node_features,node_transform,node_inference,node_display,node_user toneBlue
class node_preparation,node_encoding,node_experiments,node_evaluation,node_ssp toneAmber
class node_dataset,node_preprocessor,node_model toneMint
```

## Components

### Classification app

- [Input and results UI](https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py): `app.py`
- [Occurrence features](https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py): `app.py`
- [Feature transformation](https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py): `app.py`
- [MLP inference](https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py): `app.py`
- [Class and probabilities](https://github.com/juiyya/cnn-gs-mlp/blob/main/app.py): `app.py`

### Model development

- [Data preparation](https://github.com/juiyya/cnn-gs-mlp/blob/main/GS_Classificacao_Roubo_vs_Furto.ipynb): `GS_Classificacao_Roubo_vs_Furto.ipynb`
- [Train-only preprocessing](https://github.com/juiyya/cnn-gs-mlp/blob/main/GS_Classificacao_Roubo_vs_Furto.ipynb): `GS_Classificacao_Roubo_vs_Furto.ipynb`
- [MLP comparison and training](https://github.com/juiyya/cnn-gs-mlp/blob/main/GS_Classificacao_Roubo_vs_Furto.ipynb): `GS_Classificacao_Roubo_vs_Furto.ipynb`
- [Validation and test evaluation](https://github.com/juiyya/cnn-gs-mlp/blob/main/GS_Classificacao_Roubo_vs_Furto.ipynb): `GS_Classificacao_Roubo_vs_Furto.ipynb`

### Deployed artifacts

- [Prepared records](https://github.com/juiyya/cnn-gs-mlp/blob/main/celular_2024.parquet): `celular_2024.parquet`
- [Saved preprocessor](https://github.com/juiyya/cnn-gs-mlp/blob/main/preprocess.joblib): `preprocess.joblib`
- [Selected MLP](https://github.com/juiyya/cnn-gs-mlp/blob/main/mlp_sp.keras): `mlp_sp.keras`

### Other components

- **User**
- **SSP-SP records**

## Connections

- User → Input and results UI: enters attributes (evidence: `README.md`)
- Input and results UI → Occurrence features: collects inputs (evidence: `app.py`)
- Input and results UI → Feature transformation: transforms inputs (evidence: `app.py`)
- Saved preprocessor → Feature transformation: provides transform (evidence: `app.py`)
- Input and results UI → MLP inference: predicts (evidence: `app.py`)
- Selected MLP → MLP inference: provides model (evidence: `app.py`)
- MLP inference → Class and probabilities: returns probabilities (evidence: `app.py`)
- Class and probabilities → User: shows result (evidence: `app.py`)
- SSP-SP records → Data preparation: supplies records (evidence: `README.md`)
- Data preparation → Prepared records: prepares records
- Data preparation → Train-only preprocessing: prepares features (evidence: `README.md`)
- Train-only preprocessing → MLP comparison and training: feeds training (evidence: `README.md`)
- MLP comparison and training → Validation and test evaluation: evaluates models (evidence: `README.md`)
- MLP comparison and training → Selected MLP: saves selected model (evidence: `README.md`)
- Train-only preprocessing → Saved preprocessor: saves transforms (evidence: `README.md`)
