# geeksgod/ctgan-cicids2017-fedids architecture

> Architecture diagram of the GitHub repository geeksgod/ctgan-cicids2017-fedids, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/geeksgod/ctgan-cicids2017-fedids
- Repository: https://github.com/geeksgod/ctgan-cicids2017-fedids

## Overview

This repository implements a federated intrusion-detection experiment that compares real-only training with CTGAN synthetic-data evaluations (TRTS and TSTR). The documented workflow is to generate synthetic traffic with the CTGAN notebook, provide real and synthetic CSVs, then run the experiment script. The experiment preprocesses data, coordinates organization-level private training and server aggregation, evaluates models, and writes metrics and visualizations. The README documents CTGAN generation, but its notebook implementation was not sampled; its connection to the experiment is therefore documented rather than source-verified.

Main entry points: [`component/FederatedIDSExperiment.py`](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/FederatedIDSExperiment.py) (Experiment orchestration), [`component/imp.py`](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/imp.py) (Shared runtime utilities), [`component/FederateConfig.py`](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/FederateConfig.py) (Federated settings), [`component/OrganizationAgent.py`](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/OrganizationAgent.py) (Organization training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_ctgan["CTGAN generation"]
  node_preprocess["Data preprocessing<br/>[DataManager.py]"]
end

subgraph group_federation["Federated learning"]
  node_experiment["Experiment orchestration"]
  node_network["IDS neural network"]
  node_organization["Organization training"]
  node_server["Federated server<br/>[FederateServer.py]"]
end

subgraph group_evaluation["Evaluation and outputs"]
  node_visualizer["Experiment visualizations<br/>[Visualizer.py]"]
  node_results["Experiment results"]
end

subgraph group_runtime["Shared runtime"]
  node_entry["Experiment entry"]
  node_config["Federated settings<br/>[FederateConfig.py]"]
  node_shared["Shared runtime utilities<br/>[imp.py]"]
end

node_operator(("Researcher"))
node_cicids["CICIDS2017 data"]

node_operator -.->|"runs notebook"| node_ctgan
node_cicids -.->|"provides dataset"| node_ctgan
node_ctgan -.->|"supplies synthetic CSV"| node_experiment
node_operator -->|"runs script"| node_entry
node_entry -->|"starts experiment"| node_experiment
node_entry -->|"sets parameters"| node_config
node_experiment -->|"uses settings"| node_config
node_experiment -->|"loads CSVs"| node_preprocess
node_preprocess -->|"reads feature settings"| node_config
node_experiment -->|"creates model"| node_network
node_experiment -->|"runs federation"| node_server
node_experiment -->|"creates agents"| node_organization
node_organization -->|"trains model"| node_network
node_organization -->|"reads training settings"| node_config
node_server -->|"evaluates global model"| node_network
node_server -->|"reads device settings"| node_config
node_experiment -->|"generates plots"| node_visualizer
node_experiment -->|"writes metrics"| node_results
node_entry -->|"imports utilities"| node_shared
node_experiment -->|"imports utilities"| node_shared
node_preprocess -->|"imports utilities"| node_shared
node_organization -->|"imports utilities"| node_shared
node_server -->|"imports utilities"| node_shared
node_visualizer -->|"imports utilities"| node_shared

click node_ctgan "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/CTGAN/600epochCTGAN.ipynb"
click node_entry "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/federated_ids_ctgan.py"
click node_experiment "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/FederatedIDSExperiment.py"
click node_config "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/FederateConfig.py"
click node_preprocess "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/DataManager.py"
click node_network "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/CybersecurityNet.py"
click node_organization "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/OrganizationAgent.py"
click node_server "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/FederateServer.py"
click node_visualizer "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/Visualizer.py"
click node_results "https://github.com/geeksgod/ctgan-cicids2017-fedids/tree/main/results"
click node_shared "https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/imp.py"

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_ctgan,node_preprocess toneBlue
class node_experiment,node_network,node_organization,node_server toneAmber
class node_visualizer,node_results toneMint
class node_entry,node_config,node_shared toneRose
class node_operator,node_cicids toneIndigo
```

## Components

### Data preparation

- [CTGAN generation](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/CTGAN/600epochCTGAN.ipynb): `CTGAN/600epochCTGAN.ipynb`
- [Data preprocessing](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/DataManager.py): `component/DataManager.py`

### Federated learning

- [Experiment orchestration](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/FederatedIDSExperiment.py): `component/FederatedIDSExperiment.py`
- [IDS neural network](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/CybersecurityNet.py): `component/CybersecurityNet.py`
- [Organization training](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/OrganizationAgent.py): `component/OrganizationAgent.py`
- [Federated server](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/FederateServer.py): `component/FederateServer.py`

### Evaluation and outputs

- [Experiment visualizations](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/Visualizer.py): `component/Visualizer.py`
- [Experiment results](https://github.com/geeksgod/ctgan-cicids2017-fedids/tree/main/results): `results`

### Shared runtime

- [Experiment entry](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/federated_ids_ctgan.py): `federated_ids_ctgan.py`
- [Federated settings](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/FederateConfig.py): `component/FederateConfig.py`
- [Shared runtime utilities](https://github.com/geeksgod/ctgan-cicids2017-fedids/blob/main/component/imp.py): `component/imp.py`

### Other components

- **Researcher**
- **CICIDS2017 data**

## Connections

- Researcher → CTGAN generation: runs notebook (evidence: `readme.md`)
- CICIDS2017 data → CTGAN generation: provides dataset (evidence: `readme.md`)
- CTGAN generation → Experiment orchestration: supplies synthetic CSV (evidence: `readme.md`)
- Researcher → Experiment entry: runs script (evidence: `readme.md`)
- Experiment entry → Experiment orchestration: starts experiment (evidence: `federated_ids_ctgan.py`)
- Experiment entry → Federated settings: sets parameters (evidence: `federated_ids_ctgan.py`)
- Experiment orchestration → Federated settings: uses settings (evidence: `component/FederatedIDSExperiment.py`)
- Experiment orchestration → Data preprocessing: loads CSVs (evidence: `component/FederatedIDSExperiment.py`)
- Data preprocessing → Federated settings: reads feature settings (evidence: `component/DataManager.py`)
- Experiment orchestration → IDS neural network: creates model (evidence: `component/FederatedIDSExperiment.py`)
- Experiment orchestration → Federated server: runs federation (evidence: `component/FederatedIDSExperiment.py`)
- Experiment orchestration → Organization training: creates agents (evidence: `component/FederatedIDSExperiment.py`)
- Organization training → IDS neural network: trains model (evidence: `component/OrganizationAgent.py`)
- Organization training → Federated settings: reads training settings (evidence: `component/OrganizationAgent.py`)
- Federated server → IDS neural network: evaluates global model (evidence: `component/FederateServer.py`)
- Federated server → Federated settings: reads device settings (evidence: `component/FederateServer.py`)
- Experiment orchestration → Experiment visualizations: generates plots (evidence: `component/FederatedIDSExperiment.py`)
- Experiment orchestration → Experiment results: writes metrics (evidence: `component/FederatedIDSExperiment.py`)
- Experiment entry → Shared runtime utilities: imports utilities (evidence: `federated_ids_ctgan.py`)
- Experiment orchestration → Shared runtime utilities: imports utilities (evidence: `component/FederatedIDSExperiment.py`)
- Data preprocessing → Shared runtime utilities: imports utilities (evidence: `component/DataManager.py`)
- Organization training → Shared runtime utilities: imports utilities (evidence: `component/OrganizationAgent.py`)
- Federated server → Shared runtime utilities: imports utilities (evidence: `component/FederateServer.py`)
- Experiment visualizations → Shared runtime utilities: imports utilities (evidence: `component/Visualizer.py`)
