How yash5429q/fedrated_collaborative_system works
CYBER-20 is a federated-learning threat-detection platform: organizations train locally, exchange model updates through a Flower aggregator, and expose threat prediction and operational telemetry through a FastAPI backend and React dashboard. The graph separates federation, inference, API/business data, persistence, and user-facing capabilities. The README documents the high-level HTTP and federated workflow; sampled source confirms client training, inference routing, and round persistence. Some feature endpoints and UI data wiring are unsampled, so their detailed internal links are omitted.
Main entry points: client.py Flower client · run_experiment.py Experiment simulation · server.py FedAvg aggregator · inference.py Prediction inference
Components 20
Federated training
- Flower client
backend/client.py - FedAvg aggregator
backend/server.py - Experiment simulation
backend/run_experiment.py
Threat ML
- Data and partitions
backend/app/ml/data.py - ThreatNet model
backend/app/ml/model.py - Privacy protections
backend/app/ml/privacy.py - Prediction inference
backend/app/ml/inference.py
Backend services
- FastAPI application
backend/app/main.py - REST endpoints
backend/app/api/v1/router.py - Dashboard and domain data
backend/app/services/db_data.py
Persistence
- Metric repository
backend/app/repositories/metric_repo.py - Domain repositories
backend/app/repositories - SQL database
backend/app/database/session.py - Training and participation records
backend/app/models/training_round.py
Dashboard
- Dashboard navigation
frontend/src/router.tsx - Management pages
frontend/src/pages - Domain data hooks
frontend/src/hooks - HTTP API client
frontend/src/lib/apiClient.ts
Other components
- Participating organizations
- Backend service
Connections 24
- Participating organizations → Flower client: train locally
README.md - Flower client → Data and partitions: loads partitions
backend/client.py - Flower client → ThreatNet model: trains model
backend/client.py - Flower client → FedAvg aggregator: sends updates
README.md - FedAvg aggregator → Training and participation records: persists rounds
backend/server.py - FedAvg aggregator → Participating organizations: aggregates updates
README.md - Experiment simulation → Data and partitions: loads data
backend/run_experiment.py - Experiment simulation → ThreatNet model: runs training
backend/run_experiment.py - Experiment simulation → Privacy protections: applies protections
backend/run_experiment.py - FastAPI application → REST endpoints: mounts routes
backend/app/main.py - REST endpoints → Prediction inference: routes prediction
backend/app/api/v1/router.py - Prediction inference → Data and partitions: uses features
backend/app/ml/inference.py - Prediction inference → ThreatNet model: runs model
backend/app/ml/inference.py - REST endpoints → Dashboard and domain data: serves domain data
- Dashboard and domain data → Metric repository: reads metrics
backend/app/services/db_data.py - Dashboard and domain data → Domain repositories: queries repositories
backend/app/services/db_data.py - Metric repository → SQL database: reads records
- Domain repositories → SQL database: accesses database
- Training and participation records → SQL database: maps records
backend/app/models/training_round.py - Dashboard navigation → Management pages: routes views
frontend/src/router.tsx - Management pages → Domain data hooks: loads domain data
- Domain data hooks → HTTP API client: fetches data
- HTTP API client → Backend service: sends HTTP requests
README.md - Backend service → FastAPI application: serves API
README.md