How labsaint/mud-hog_federated_learning works
Main Components
• Experiment Runner / Orchestrator: Identify the main script files (main.py, _main.py, run_hete_fashion.sh) which kick off the experiments.
• Clients: Represent the modules in clients.py and clients_attackers.py. These simulate the behavior of benign, malicious, and unreliable clients in the federated learning loop.
• Server/Aggregator: Include server.py as the central aggregation point that collects and processes client updates.
• Dataset & Task Modules: Under the “tasks” directory are several task-specific scripts (e.g., cifar.py, fashion_mnist.py, mnist.py, imdb.py, and imdb_bert.py) which set up the training tasks and datasets for the FL experiments.
• Utility Modules: The “utils” directory (with scripts like allocateGPU.py, backdoor_semantic_utils.py, backdoor_utils.py, blur_images.py, and other general utils) provides helper functions and additional experiment functionalities like backdoor triggering and GPU allocation.
• Data Loader: The dataloader.py module is responsible for preparing the data distributions for the clients (including IID, non-IID, etc.).
• Experiment Parser & Configuration: parser.py, along with the command-line options laid out in the README, shows how experiments are configured and parameters are passed throughout the simulation.
Relationships and Interactions
• Client-Server Communication: Represent the two-way communication between multiple Client modules and the Aggregator (server.py). Emphasize that clients update their local models and upload gradient updates (including potential malicious modifications) to the server.
• Task Execution: Show that various task modules (located in the “tasks” directory) define the experimental setup, data domain (e.g., MNIST, CIFAR, IMDB), and nature of the training, which feeds into the overall FL cycle.
• Utility Integration: Illustrate that utility functions (from the utils directory) are employed at several stages across the data preprocessing, client simulation (e.g., inducing noise, backdoor attacks), and even hardware resource allocation.
Architectural Patterns and Design Principles
• Extensibility: Since different tasks and attacks can be plugged in, showing “interfaces” or key connection points between components (like where attack parameters or aggregation rules are set up) is useful.