# aliz-f/edge-web-attack-detection-federated architecture

> Architecture diagram of the GitHub repository aliz-f/edge-web-attack-detection-federated, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aliz-f/edge-web-attack-detection-federated
- Repository: https://github.com/aliz-f/edge-web-attack-detection-federated

## Overview

This repository contains Flower-based federated intrusion-detection experiments using a compact 1D-CNN, organized around binary, six-class, and fifteen-class evaluation. The principal workflow partitions Edge-IIoTset data among clients, trains locally, shares model updates with a server for aggregation, and evaluates the resulting model; raw traffic remains local. Separate experiment variants investigate aggregation strategies and hyperparameter tuning, with plots and simulation configurations supporting result analysis. The runtime links below follow README statements and sampled client code; server wiring and several task implementations were not inspected.

Main entry points: [`1d-cnn_model/2-class/simulations/1d-cnn/client_app.py`](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/client_app.py) (Flower clients), [`1d-cnn_model/2-class/simulations/1d-cnn/server_app.py`](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/server_app.py) (Flower server), [`1d-cnn_model/15-class/hyper_parameters_tuning/tune_fl_optuna.py`](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/15-class/hyper_parameters_tuning/tune_fl_optuna.py) (Hyperparameter tuning), [`1d-cnn_model/6-class/simulations/fedavg/with_hyper_parameters_tuning/run_simulations.py`](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/6-class/simulations/fedavg/with_hyper_parameters_tuning/run_simulations.py) (Simulation scenarios)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tasks["Classification tasks"]
  node_binary["Binary task<br/>[task.py]"]
  node_sixclass["Six-class task"]
  node_fifteen["Fifteen-class task"]
end

subgraph group_runtime["Federated runtime"]
  node_clients["Flower clients<br/>[client_app.py]"]
  node_cnn["Local 1D-CNN<br/>[client_app.py]"]
  node_server["Flower server<br/>[server_app.py]"]
  node_aggregation["Aggregation strategy<br/>[strategies.py]"]
end

subgraph group_experiments["Tuning experiments"]
  node_hypersearch["Hyperparameter tuning<br/>[tune_fl_optuna.py]"]
  node_strategytests["Strategy tuning<br/>[strategies.py]"]
  node_simulations["Simulation scenarios<br/>[run_simulations.py]"]
end

subgraph group_analysis["Result analysis"]
  node_metrics["Federated results"]
  node_tuningresults["Tuning results<br/>[plot_fl_optuna.py]"]
end

node_researcher(("Experimenter"))
node_dataset[("Edge-IIoTset")]

node_researcher -->|"selects task"| node_binary
node_researcher -->|"selects task"| node_sixclass
node_researcher -->|"selects task"| node_fifteen
node_dataset -->|"local partitions"| node_clients
node_clients -->|"trains locally"| node_cnn
node_clients -->|"sends updates"| node_server
node_server -->|"aggregates updates"| node_aggregation
node_server -->|"redistributes model"| node_clients
node_researcher -->|"tunes parameters"| node_hypersearch
node_researcher -->|"tunes strategy"| node_strategytests
node_researcher -->|"runs scenarios"| node_simulations
node_simulations -.->|"supports analysis"| node_metrics
node_hypersearch -.->|"analyzes trials"| node_tuningresults

click node_binary "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/task.py"
click node_sixclass "https://github.com/aliz-f/edge-web-attack-detection-federated/tree/main/1d-cnn_model/6-class/strategy_tuning/1d-cnn"
click node_fifteen "https://github.com/aliz-f/edge-web-attack-detection-federated/tree/main/1d-cnn_model/15-class/simulations/fedmedian/with_hyper_parameters_tuning/1d-cnn"
click node_clients "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/client_app.py"
click node_cnn "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/client_app.py"
click node_server "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/server_app.py"
click node_aggregation "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/6-class/strategy_tuning/1d-cnn/utils/strategies.py"
click node_hypersearch "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/15-class/hyper_parameters_tuning/tune_fl_optuna.py"
click node_strategytests "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/6-class/strategy_tuning/1d-cnn/utils/strategies.py"
click node_simulations "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/6-class/simulations/fedavg/with_hyper_parameters_tuning/run_simulations.py"
click node_metrics "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/plot_federated_results.py"
click node_tuningresults "https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/15-class/hyper_parameters_tuning/plot_fl_optuna.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_binary,node_sixclass,node_fifteen toneBlue
class node_clients,node_cnn,node_server,node_aggregation,node_dataset toneAmber
class node_hypersearch,node_strategytests,node_simulations toneMint
class node_metrics,node_tuningresults toneRose
class node_researcher toneIndigo
```

## Components

### Classification tasks

- [Binary task](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/task.py): `1d-cnn_model/2-class/simulations/1d-cnn/task.py`
- [Six-class task](https://github.com/aliz-f/edge-web-attack-detection-federated/tree/main/1d-cnn_model/6-class/strategy_tuning/1d-cnn): `1d-cnn_model/6-class/strategy_tuning/1d-cnn`
- [Fifteen-class task](https://github.com/aliz-f/edge-web-attack-detection-federated/tree/main/1d-cnn_model/15-class/simulations/fedmedian/with_hyper_parameters_tuning/1d-cnn): `1d-cnn_model/15-class/simulations/fedmedian/with_hyper_parameters_tuning/1d-cnn`

### Federated runtime

- [Flower clients](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/client_app.py): `1d-cnn_model/2-class/simulations/1d-cnn/client_app.py`
- [Local 1D-CNN](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/client_app.py): `1d-cnn_model/2-class/simulations/1d-cnn/client_app.py`
- [Flower server](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/1d-cnn/server_app.py): `1d-cnn_model/2-class/simulations/1d-cnn/server_app.py`
- [Aggregation strategy](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/6-class/strategy_tuning/1d-cnn/utils/strategies.py): `1d-cnn_model/6-class/strategy_tuning/1d-cnn/utils/strategies.py`

### Tuning experiments

- [Hyperparameter tuning](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/15-class/hyper_parameters_tuning/tune_fl_optuna.py): `1d-cnn_model/15-class/hyper_parameters_tuning/tune_fl_optuna.py`
- [Strategy tuning](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/6-class/strategy_tuning/1d-cnn/utils/strategies.py): `1d-cnn_model/6-class/strategy_tuning/1d-cnn/utils/strategies.py`
- [Simulation scenarios](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/6-class/simulations/fedavg/with_hyper_parameters_tuning/run_simulations.py): `1d-cnn_model/6-class/simulations/fedavg/with_hyper_parameters_tuning/run_simulations.py`

### Result analysis

- [Federated results](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/2-class/simulations/plot_federated_results.py): `1d-cnn_model/2-class/simulations/plot_federated_results.py`
- [Tuning results](https://github.com/aliz-f/edge-web-attack-detection-federated/blob/main/1d-cnn_model/15-class/hyper_parameters_tuning/plot_fl_optuna.py): `1d-cnn_model/15-class/hyper_parameters_tuning/plot_fl_optuna.py`

### Other components

- **Experimenter**
- **Edge-IIoTset**

## Connections

- Experimenter → Binary task: selects task (evidence: `README.md`)
- Experimenter → Six-class task: selects task (evidence: `README.md`)
- Experimenter → Fifteen-class task: selects task (evidence: `README.md`)
- Edge-IIoTset → Flower clients: local partitions (evidence: `README.md`)
- Flower clients → Local 1D-CNN: trains locally (evidence: `1d-cnn_model/2-class/simulations/1d-cnn/client_app.py`)
- Flower clients → Flower server: sends updates (evidence: `README.md`)
- Flower server → Aggregation strategy: aggregates updates (evidence: `README.md`)
- Flower server → Flower clients: redistributes model (evidence: `README.md`)
- Experimenter → Hyperparameter tuning: tunes parameters (evidence: `README.md`)
- Experimenter → Strategy tuning: tunes strategy (evidence: `README.md`)
- Experimenter → Simulation scenarios: runs scenarios (evidence: `README.md`)
- Simulation scenarios → Federated results: supports analysis
- Hyperparameter tuning → Tuning results: analyzes trials
