# hanselgray/it4630e-bytedroid architecture

> Architecture diagram of the GitHub repository hanselgray/it4630e-bytedroid, 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/hanselgray/it4630e-bytedroid
- Repository: https://github.com/hanselgray/it4630e-bytedroid

## Overview

##### Main Components
- Data Input & Collection:
- Data sources are expected to originate from Dalvik Executable Files (DEX) contained in the datasets mentioned in the README.
- Data Extraction Module:
- Core logic found in extract_data.py, which likely handles the extraction of relevant features from the raw Android APK/DEX input.
- Chunk Splitting Module:
- Split_into_chunk_extract.py, which seems to process or partition the extracted data for further analysis.
- Word2Vec-based Feature Extraction:
- Word2vec_respawn.ipynb component. This module implements embedding techniques (based on the ByteDroid paper) to convert raw or chunked data into vector representations.
- Dimensionality Reduction/PCA:
- Pca_train.ipynb component that handles PCA training to reduce feature dimensionality, ensuring efficient model training or further analysis.
- Documentation/Research Reference:
- ByteDroid.pdf as a reference component; although it isn’t a running part of the system, it underpins the implemented methodology.

##### Defining Relationships and Interactions
- Data Flow begins with the available dataset (external sources referenced in the README). Then:
- Data flows into the Data Extraction Module to pull out necessary features from the raw Dalvik Executable Files.
- The output from data extraction is passed to the Chunk Splitting Module, ensuring data is segmented suitably for analysis.
- Next, the segmented data is fed into the Word2Vec module to compute vectorized representations.
- The generated vectors are then processed by the PCA module for dimensionality reduction.
- Each stage forms a pipeline where the output of one component acts as the input for the next, reflecting a sequential data processing and transformation flow.

##### Architectural Patterns & Design Principles
- Pipeline Architecture:
- Modularity & Separation of Concerns:
- Extensibility:
- Although this implementation is proof-of-concept, mark potential integration points where additional components (like a classification or detection module) might be added in the future.

##### Including Relevant Technologies and Libraries
- Python scripts and Jupyter notebooks indicate that the implementation is predominantly Python-based.
- Underlying libraries might include libraries for data processing (e.g., Pandas or NumPy), machine learning libraries (for PCA, perhaps scikit-learn), and natural language processing libraries for Word2Vec (like Gensim), though specific libraries aren’t explicitly mentioned.
- Reference to established research (ByteDroid.pdf) underlines that the technological decisions are driven by academic implementations.

##### Specific Elements
- Clear labels for each component:
– “Data Extraction” (extract_data.py)
– “Chunk Splitting” (split_into_chunk_extract.py)
– “Word2Vec Feature Extraction” (word2vec_respawn.ipynb)
– “PCA Training/Dimensionality Reduction” (pca_train.ipynb)
– “Reference: ByteDroid Research” (ByteDroid.pdf)
- Annotations that detail the data transformations at each step (e.g., “Raw Data → Extracted Features → Chunked Data → Vectorized Features → PCA Reduced Representation”).

##### Final Recommendations
- Be as detailed as possible. Even simple modules should be clearly represented to capture all architectural elements.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Global Components
    Raw["Raw Android DEX Files"]:::input

    subgraph "Processing Pipeline"
        direction TB
        ext["Data Extraction"]:::python
        chunk["Chunk Splitting"]:::python
        word2vec["Word2Vec Feature Extraction"]:::notebook
        pca["PCA Training/Dimensionality Reduction"]:::notebook
    end

    ref["Reference: ByteDroid Research"]:::doc

    %% Data Flow Connections
    Raw -->|"extracts"| ext
    ext -->|"splits"| chunk
    chunk -->|"vectorizes"| word2vec
    word2vec -->|"reduces"| pca
    word2vec -.->|"guidedBy"| ref

    %% Click Events for Component Mapping
    click ext "https://github.com/hanselgray/it4630e-bytedroid/blob/main/extract_data.py"
    click chunk "https://github.com/hanselgray/it4630e-bytedroid/blob/main/split_into_chunk_extract.py"
    click word2vec "https://github.com/hanselgray/it4630e-bytedroid/blob/main/word2vec_respawn.ipynb"
    click pca "https://github.com/hanselgray/it4630e-bytedroid/blob/main/pca_train.ipynb"
    click ref "https://github.com/hanselgray/it4630e-bytedroid/blob/main/ByteDroid.pdf"

    %% Styling Classes
    classDef input fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef python fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef notebook fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef doc fill:#f8d7da,stroke:#721c24,stroke-width:2px;
```
