Skip to content
Back to skills

Federated Learning Cross Device

ASecurity

Use when implementing cross-device federated learning.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 10, 2026
ai-agentspython

Works with

  • cli

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill federated-learning-cross-device --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Federated Learning Cross Device?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Federated Learning Cross Device
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-federated-learning-cross-device/badge)](https://www.skillsdirectory.com/skills/loopyluci-federated-learning-cross-device)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: federated-learning-cross-device
description: "Use when implementing cross-device federated learning."
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
  hermes:
    tags: [federated-learning, cross-device, privacy, FL, Flower, TFF, aggregation]
    related_skills: [edge-ai-tinyml, differential-privacy-training, on-device-ml-optimization, data-synthesis-generation]
---

# Cross-Device Federated Learning

Implementing federated learning across devices — from FedAvg and secure aggregation through Flower/TensorFlow Federated setup, differential privacy, and production deployment.

## When to Use

- Training ML models on user data without centralizing it
- Privacy-preserving ML across mobile or edge devices
- Improving models from on-device data
- Compliance with data residency requirements

## Federated Learning Framework

```python
import flwr as fl

class FederatedClient(fl.client.NumPyClient):
    """Flower federated learning client."""
    def __init__(self, model, train_data, val_data):
        self.model = model
        self.x_train, self.y_train = train_data
        self.x_val, self.y_val = val_data
    
    def get_parameters(self, config):
        return self.model.get_weights()
    
    def fit(self, parameters, config):
        self.model.set_weights(parameters)
        self.model.fit(self.x_train, self.y_train, epochs=1, batch_size=32)
        return self.model.get_weights(), len(self.x_train), {}
    
    def evaluate(self, parameters, config):
        self.model.set_weights(parameters)
        loss, accuracy = self.model.evaluate(self.x_val, self.y_val)
        return loss, len(self.x_val), {'accuracy': accuracy}

# Server-side aggregation strategy
strategy = fl.server.strategy.FedAvg(
    min_fit_clients=10, min_available_clients=50,
    fraction_fit=0.2, fraction_evaluate=0.1,
)
```

## Verification Checklist

- [ ] FL framework chosen (Flower, TFF, PySyft, NVIDIA FLARE)
- [ ] Client selection strategy defined (fraction_fit, min_clients)
- [ ] Secure aggregation protocol (if privacy required)
- [ ] Differential privacy added to client updates
- [ ] Communication efficiency (compression, fewer rounds)
- [ ] Heterogeneity handled (different device capabilities, data distributions)
- [ ] Privacy guarantees documented (epsilon, delta)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.