Bring your own components for federated learning

The components used in Federated Learning are designed to allow for users to bring their own components in a modular bring your own components (BYOC) way.

Since the implementation of Federated Learning in Clara Train 3.1, much has changed in the underlying architecture so aggregators, privacy filters, and even trainers are FLComponents that cah be replaced with custom BYOC implementations as long they match the needed signatures.

Model Aggregator

Model aggregation happens on the FL Server as specified in the config_fed_server.json file. Clara train comes with a built in aggregator:

Built in aggregator

This aggregator is based on an algorithm in Federated Learning for Breast Density Classification: A Real-World Implementation. The ModelAggregator computes a weighted sum of the model gradients from each client, where the default weights are based on the number of training iterations that the client executed in this round of FL. The user can further adjust the client weights by adding custom weights in the argument of this component in config_fed_server.json.

Bring your own Aggregator to FL

Users can write their own aggregators, and just change the component name tag into path to point to the custom code like for BYOC. A sample of a custom aggregator is shown below: