# jmallone/classificador_mestrado architecture

> Architecture diagram of the GitHub repository jmallone/classificador_mestrado, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jmallone/classificador_mestrado
- Repository: https://github.com/jmallone/classificador_mestrado

## Overview

Step 1. Identify the Main Components
- Data Sources & Input Files
- Raw Feature Files: Located in the features_raw directory (with separate subdirectories for DTD and FMD versions).
- Feature Conversion Module
- Notebooks (converter.ipynb) in each dataset folder under features_raw serve to convert/extract the raw features into a standardized format.
- Pipeline Orchestration
- The central “rodar_all.py” script acts as the orchestrator for running the training pipeline, which likely includes data pre-processing and model training steps.
- Supporting scripts such as raw_2_npy_michel.py and run_params_michel.py are used to transform or manage the features and runtime parameters.
- Model Training & Evaluation
- This component uses the pre-processed features and labels to train models using various backbones.
- The README refers to evaluation and comparison across backbones (e.g., ResNet, VGG, Inception).
- Notification & Result Visualization
- send_discord.py is used to send notifications (likely when training/evaluation completes).
- ver_resultados.ipynb and verificar.py assist in verifying or visualizing the results.

Step 2. Outline Relationships and Interactions
- Data Ingestion Layer
- Feature Conversion Process
- After conversion, the system requires a manual replacement (via copying the correct labels directory to a generic “labels” folder) to align the labels with the expected dataset.
- Training Pipeline
- The central orchestration script (rodar_all.py) initiates and controls the training workflow. Components or modules like raw_2_npy_michel.py and run_params_michel.py feed data inputs into the training routines.
- Model Evaluation and Notification
- Once models are trained, evaluation modules (referenced by ver_resultados.ipynb and verificar.py) inspect the outcomes and performance.
- Finally, the notification system (send_discord.py) communicates the results.

Step 3. Architectural Patterns & Design Principles
- Modular Pipeline Architecture
- The system is divided into modular steps (feature extraction, conversion, training, evaluation), reflecting a pipeline pattern.
- Separation of Concerns
- Each component (converter, training orchestrator, evaluation/notification) is kept separate in the file structure and in their corresponding script or notebook.
- Standardized Data Formats
- The README emphasizes a consistent file naming pattern and data format for features (including numeric feature values, label names, and file names).

Step 4. Relevant Technologies & Frameworks
- Python-based Execution:
- All scripts and notebooks are Python-based. The dependency file (requirements.txt) will list the needed libraries (likely including deep learning frameworks).
- Notebooks for Data Processing:
- The use of Jupyter notebooks (converter.ipynb) is an important part of the conversion process.
- Notification Mechanism:
- The use of a Discord API (via send_discord.py) highlights integration with external messaging/notification services.
- Model Training Libraries:
- While not explicitly outlined, the mention of backbones such as ResNet, VGG, and Inception indicates the usage of deep learning libraries (e.g., PyTorch or TensorFlow).

- Data Input Layer: Representing raw feature files (from features_raw) and label files (from labels_DTD and labels_FMD).
- Data Processing Layer: Representing the feature conversion notebooks and scripts.
- Pipeline Control Layer: Highlight the central orchestrator (rodar_all.py) and helper scripts.
- Model Training & Evaluation Layer: Indicating the parts where models are trained and evaluated.
- Notification & Visualization Layer: Mark the components that handle sending external notifications and result inspection.

##### Notes for manually triggered steps
- That the user must “copy” or “replace” the correct labels folder as per the README instructions before pipeline execution.

Step 6. High-Level Instructions for the Principal Software Engineer
- Interdependencies such as the conversion outputs feeding into the training module.
- Manual preprocessing steps (like copying the label folder) as side annotations.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Data Input Layer
    subgraph "Data Input Layer"
        RAW_DTD["Raw Feature Files (DTD)"]:::dataInput
        RAW_FMD["Raw Feature Files (FMD)"]:::dataInput
        LABELS_DTD["Label Files (DTD)"]:::dataInput
        LABELS_FMD["Label Files (FMD)"]:::dataInput
    end

    %% Feature Conversion Layer
    subgraph "Feature Conversion Layer"
        CONV_DTD["Converter Notebook (DTD)"]:::processing
        CONV_FMD["Converter Notebook (FMD)"]:::processing
        CONV_FEATURES["Converted Features"]:::processing
    end

    %% Pipeline Control Layer
    subgraph "Pipeline Control Layer"
        ORCHESTRATION["Orchestration Script (rodar_all.py)"]:::orchestration
        RAW2NPY["Feature Transformation (raw_2_npy_michel.py)"]:::orchestration
        RUNPARAMS["Parameter Manager (run_params_michel.py)"]:::orchestration
        TRAIN_PIPELINE["Training Pipeline"]:::orchestration
    end

    %% Model Training & Evaluation Layer
    subgraph "Model Training & Evaluation Layer"
        TRAINING["Model Training"]:::training
        EVAL_NOTEBOOK["Evaluation Notebook (ver_resultados.ipynb)"]:::training
        VERIFICAR["Verification Script (verificar.py)"]:::training
    end

    %% Notification & Visualization Layer
    subgraph "Notification & Visualization Layer"
        DISCORD["Notification Module (send_discord.py)"]:::notification
    end

    %% Connections: Data Input -> Conversion
    RAW_DTD -->|"process"| CONV_DTD
    RAW_FMD -->|"process"| CONV_FMD

    %% Conversion outputs
    CONV_DTD --> CONV_FEATURES
    CONV_FMD --> CONV_FEATURES

    %% Labels (manual copy) -> Training Pipeline
    LABELS_DTD -.->|"manual_copy"| TRAIN_PIPELINE
    LABELS_FMD -.->|"manual_copy"| TRAIN_PIPELINE

    %% Converted Features -> Training Pipeline
    CONV_FEATURES --> TRAIN_PIPELINE

    %% Pipeline Control feeding into Training Pipeline
    ORCHESTRATION --> TRAIN_PIPELINE
    RAW2NPY --> TRAIN_PIPELINE
    RUNPARAMS --> TRAIN_PIPELINE

    %% Training Pipeline to Model Training
    TRAIN_PIPELINE --> TRAINING

    %% Model Training to Evaluation Components
    TRAINING --> EVAL_NOTEBOOK
    TRAINING --> VERIFICAR

    %% Evaluation to Notification
    EVAL_NOTEBOOK --> DISCORD
    VERIFICAR --> DISCORD

    %% Click Events
    click RAW_DTD "https://github.com/jmallone/classificador_mestrado/tree/main/features_raw/DTD_DIEGO"
    click RAW_FMD "https://github.com/jmallone/classificador_mestrado/tree/main/features_raw/FMD_DIEGO"
    click LABELS_DTD "https://github.com/jmallone/classificador_mestrado/tree/main/labels_DTD"
    click LABELS_FMD "https://github.com/jmallone/classificador_mestrado/tree/main/labels_FMD"
    click CONV_DTD "https://github.com/jmallone/classificador_mestrado/blob/main/features_raw/DTD_DIEGO/converter.ipynb"
    click CONV_FMD "https://github.com/jmallone/classificador_mestrado/blob/main/features_raw/FMD_DIEGO/converter.ipynb"
    click ORCHESTRATION "https://github.com/jmallone/classificador_mestrado/blob/main/rodar_all.py"
    click RAW2NPY "https://github.com/jmallone/classificador_mestrado/blob/main/raw_2_npy_michel.py"
    click RUNPARAMS "https://github.com/jmallone/classificador_mestrado/blob/main/run_params_michel.py"
    click EVAL_NOTEBOOK "https://github.com/jmallone/classificador_mestrado/blob/main/ver_resultados.ipynb"
    click VERIFICAR "https://github.com/jmallone/classificador_mestrado/blob/main/verificar.py"
    click DISCORD "https://github.com/jmallone/classificador_mestrado/blob/main/send_discord.py"

    %% Styles
    classDef dataInput fill:#f4f9ff,stroke:#333,stroke-width:2px;
    classDef processing fill:#e0f7e9,stroke:#337,stroke-width:2px;
    classDef orchestration fill:#ffe0e9,stroke:#d33,stroke-width:2px;
    classDef training fill:#fff3cd,stroke:#b59,stroke-width:2px;
    classDef notification fill:#d1f7d1,stroke:#388,stroke-width:2px;
```
