# kaintels/nn-vmd architecture

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

- Interactive diagram: https://gitdiagram.com/kaintels/nn-vmd
- Repository: https://github.com/kaintels/nn-vmd

## Overview

##### Main Components

a) Data Processing Pipeline:
- Input Layer (ECG5000 Dataset)
- VMD Processing Layer (Julia-based)
- Preprocessing Layer (Python-based)

b) Model Architecture:
- Multiple Model Types:
- VAE (Variational Auto Encoder)
- CNN (Convolutional Neural Network)
- Multi-task Learning Component

c) Runtime Environment:
- Docker Container
- GPU/CPU Support Layer
- Julia-Python Interop Layer

**[Data Flow]**
**Input Data → VMD Processing → Neural Network Models → Output**

**[Component Interaction]**
**Julia Components ←→ Python Components ←→ GPU/CPU Runtime**

##### Specific Elements

a) Data Processing Section:
- ECG5000 data input
- To preprocessing.jl for VMD operations
- Link to util.py for Python-based preprocessing

b) Model Section:
- Parallel paths for different models:
- VAE Branch
- CNN Branch
- Multi-task Learning Branch
- Model.py as the central model definition point

c) Execution Environment:
- Docker container boundary
- GPU/CPU execution layer
- Julia-Python bridge (via julia_setting.py)

##### Important Relationships to Highlight

- Julia-Python interaction for VMD processing
- Data transformation flow
- Model selection paths
- GPU/CPU execution paths
- Docker container boundaries

##### Technical Details

- Python 3.7+ requirement
- Julia 1.7+ requirement
- NVIDIA CUDA support
- File dependencies:
- requirements.txt for Python
- requirements.jl for Julia
- Dockerfile for containerization

Level 1: High-level system overview
- Main components and data flow

Level 2: Detailed component interaction
- Model architecture details
- Environment setup

Level 3: Implementation details
- File dependencies
- Configuration settings
- Runtime requirements

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Sections
    subgraph Data_Processing["Data Processing Pipeline"]
        Input[("Input Data<br/>(ECG5000)")]
        DataScripts["Data Scripts"]
        Dataset["Dataset Storage"]
        VMDProcess["VMD Processing<br/>(Julia)"]
        PyPreprocess["Python<br/>Preprocessing"]
    end

    subgraph Model_Layer["Model Architecture"]
        ModelArch["Model Architecture"]
        VAE["VAE"]
        CNN["CNN"]
        MTL["Multi-task<br/>Learning"]
        Training["Training System"]
    end

    subgraph Runtime_Env["Runtime Environment"]
        Docker["Docker Container"]
        GPU["GPU Support"]
        CPU["CPU Support"]
        JuliaPython["Julia-Python<br/>Bridge"]
        Dependencies["Dependencies"]
    end

    %% Relationships
    Input --> DataScripts
    DataScripts --> Dataset
    Dataset --> VMDProcess
    VMDProcess --> PyPreprocess
    PyPreprocess --> ModelArch

    ModelArch --> VAE
    ModelArch --> CNN
    ModelArch --> MTL
    VAE & CNN & MTL --> Training

    JuliaPython --> VMDProcess
    Docker --> GPU
    Docker --> CPU
    Dependencies --> Docker

    %% Styling
    classDef data fill:#3498db,stroke:#2980b9,color:white
    classDef model fill:#2ecc71,stroke:#27ae60,color:white
    classDef runtime fill:#e67e22,stroke:#d35400,color:white
    classDef interop fill:#9b59b6,stroke:#8e44ad,color:white

    class Input,DataScripts,Dataset,VMDProcess,PyPreprocess data
    class ModelArch,VAE,CNN,MTL,Training model
    class Docker,GPU,CPU runtime
    class JuliaPython,Dependencies interop

    %% Click Events
    click DataScripts "https://github.com/kaintels/NN-VMD/blob/main/data.sh"
    click Dataset "https://github.com/kaintels/NN-VMD/tree/main/dataset/"
    click VMDProcess "https://github.com/kaintels/NN-VMD/blob/main/utils/preprocessing.jl"
    click PyPreprocess "https://github.com/kaintels/NN-VMD/blob/main/utils/util.py"
    click ModelArch "https://github.com/kaintels/NN-VMD/blob/main/models/model.py"
    click Training "https://github.com/kaintels/NN-VMD/blob/main/train.py"
    click Docker "https://github.com/kaintels/NN-VMD/tree/main/Dockerfile"
    click JuliaPython "https://github.com/kaintels/NN-VMD/blob/main/julia_setting.py"
    click Dependencies "https://github.com/kaintels/NN-VMD/blob/main/requirements.txt"

    %% Legend
    subgraph Legend
        L1["Data Processing"]:::data
        L2["Model Components"]:::model
        L3["Runtime Components"]:::runtime
        L4["Interop Components"]:::interop
    end
```
