# trivikram-yeluri/gan-project architecture

> Architecture diagram of the GitHub repository trivikram-yeluri/gan-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trivikram-yeluri/gan-project
- Repository: https://github.com/trivikram-yeluri/gan-project

## Overview

##### Project type and purpose
- This is a full-stack machine learning system focused on anti-malware detection.
- It combines data pipelines (datasets/datalakes), deep learning training (GANs, CNNs), evaluation/analysis notebooks, and eventual deployment (API, real-time detection).

##### File structure
Top-level:
- README.md – project overview
- ml-antimalware.ipynb – primary Jupyter notebook for training/testing
- dataset_malwares.csv, dataset_test.csv – raw data files
- yaml/ – configuration files (e.g., model or pipeline specs)
As described in README (even if not present in the file tree):
- datasets/ – organizes raw and preprocessed data
- models/ – stores trained GAN, CNN, Hybrid models
- notebooks/ – exploratory, analysis, reporting
- src/ – core pipeline scripts (data ingestion, preprocessing, training loops, evaluation, utilities)

##### README insights
- Core ML components: GAN generator/discriminator, CNN classifier, hybrid deep-learning model.
- Workflow phases: data ingestion → synthetic sample generation → classifier training → performance analysis → future deployment.
- Dependencies: TensorFlow/PyTorch (GAN, CNN), Pandas/NumPy (data), Matplotlib/Seaborn (plots), Jupyter.

a. Main components:
1. Data Layer
- Raw Dataset (malware & benign CSVs)
- Preprocessor (feature extraction, normalization)
2. Training Pipelines
- GAN Module: Generator ↔ Discriminator loop
- CNN Classifier Module
- Hybrid Model Module (ensemble or stacked)
3. Storage
- Model Store (models/)
- Logs & Metrics (accuracy, FPR, training history)
4. Analysis & Monitoring
- Jupyter Notebooks (notebooks/)
- Visualization dashboards
5. Deployment/API (future)
- RESTful service wrapping classifier
- Real-time feature extractor → classifier → decision

b. Relationships & Data Flow
- Raw Data → Preprocessor → Feature Batches →
→ GAN Training (generates synthetic malware samples) → Augmented Dataset →
→ CNN/Hybrid Training → Trained Models → Model Store
- Trained Models + Held-out Test Data → Evaluation Module → Metrics →
→ Reports/Notebooks
- Future: Incoming files → Feature Extractor → Classifier API → Predictions

c. Architectural Patterns & Design Principles
- Modular pipelines: separate data, training, inference, evaluation.
- MVC-style separation:
- Model (GAN, CNN, Hybrid in models/)
- Controller (src/scripts orchestrating training/eval)
- View (Jupyter notebooks, plots)
- Reproducibility via yaml configs.
- Extensibility: plug in new model architectures or datasets by adding to src/ and updating configs.

d. Key Technologies & Frameworks
- TensorFlow/PyTorch for deep learning
- Pandas/NumPy for data manipulation
- Jupyter for interactive analysis
- YAML for pipeline/config management
- (Future) Flask/FastAPI for deployment

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Project Overview
    PO["Project Overview"]:::process
    click PO "https://github.com/trivikram-yeluri/gan-project/blob/main/README.md"

    %% Data Layer
    subgraph "Data Layer"
        RD1["Raw Malware Dataset"]:::datastore
        RD2["Raw Test Dataset"]:::datastore
        Pre["Preprocessor"]:::process
        FB["Feature Batches"]:::process
        RD1 -->|ingest| Pre
        RD2 -->|ingest| Pre
        Pre -->|extract features| FB
    end

    click RD1 "https://github.com/trivikram-yeluri/gan-project/blob/main/dataset_malwares.csv"
    click RD2 "https://github.com/trivikram-yeluri/gan-project/blob/main/dataset_test.csv"

    %% Configurations
    Configs["YAML Configs"]:::process
    click Configs "https://github.com/trivikram-yeluri/gan-project/tree/main/yaml/"

    PO -->|init| Configs
    Configs --> Pre

    %% Training Pipelines
    subgraph "Training Pipelines"
        subgraph GAN_Module["GAN Module"]
            style GAN_Module stroke:#333,stroke-width:2px
            GG["Generator"]:::process
            GD["Discriminator"]:::process
            GG -->|generate synthetic samples| GD
            GD -->|feedback| GG
        end
        FB -->|train| GG
        FB -->|train| GD
        ADS["Augmented Dataset"]:::datastore
        GD -->|output synthetic samples| ADS
        FB -->|merge with synthetic| ADS

        CNN["CNN Classifier"]:::model
        HYB["Hybrid Model"]:::model
        ADS -->|train| CNN
        ADS -->|train| HYB
    end

    %% Storage
    subgraph "Storage"
        MS["Model Store"]:::artifact
        LM["Logs & Metrics"]:::artifact
        CNN -->|save| MS
        HYB -->|save| MS
        GG -->|save checkpoints| MS
        GD -->|save checkpoints| MS
        CNN -->|metrics| LM
        HYB -->|metrics| LM
    end

    %% Analysis & Monitoring
    subgraph "Analysis & Monitoring"
        NB["Training & Evaluation Notebook"]:::analysis
        DB["Visualization Dashboards"]:::analysis
        MS -->|load models| NB
        LM -->|load metrics| NB
        NB -->|generate plots| DB
    end

    click NB "https://github.com/trivikram-yeluri/gan-project/blob/main/ml-antimalware.ipynb"

    %% Deployment (Future)
    subgraph "Deployment/API (Future)"
        FE["Real-time Feature Extractor"]:::future
        API["Classifier API"]:::future
        FE -->|features| API
        API -->|predictions| API
    end

    %% Inference Path
    subgraph "Inference Path"
        IN["Incoming Files"]:::datastore
        IN -->|ingest| FE
        API -->|return| IN
    end

    %% Legend Annotations (optional grouping)
    classDef datastore fill:#A8DADC,stroke:#1D3557,color:#1D3557;
    classDef process fill:#A8E6CF,stroke:#2E7D32,color:#2E7D32;
    classDef model fill:#FFD6A5,stroke:#E65100,color:#E65100;
    classDef artifact fill:#FF8BA7,stroke:#C2185B,color:#C2185B;
    classDef analysis fill:#D4A5FF,stroke:#6A1B9A,color:#4A148C;
    classDef future fill:#E0E0E0,stroke:#616161,color:#212121;
```
