本文へ移動
cccskills
無料GitHub で公開

designing-federated-learning-architecture

Architecture guide for GDPR-compliant federated learning systems. Covers horizontal and vertical FL, aggregation strategies (FedAvg, FedProx), communication efficiency, secure aggregation, and differential privacy integration. Includes privacy guarantees analysis and deployment patterns for cross-organizational ML without data sharing.

インストール方法を見る

含まれるファイル(5)

  • SKILL.md10.6 KB
  • assets/template.md3.5 KB
  • references/standards.md3.0 KB
  • references/workflows.md6.5 KB
  • scripts/process.py13.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Designing Federated Learning Architecture

Overview

Federated Learning (FL) enables multiple parties to collaboratively train a machine learning model without sharing their raw data. Each participant trains a local model on their own data and shares only model updates (gradients or parameters) with a central aggregator. The aggregated model benefits from all participants' data without any single party accessing another's dataset.

FL directly supports GDPR Article 5(1)(c) data minimization (only model updates are shared, not personal data), Article 25(1) data protection by design (privacy is built into the architecture), and can reduce the need for cross-border data transfers under Chapter V (data stays in its jurisdiction of origin).

FL Architectures

Horizontal Federated Learning

Participants share the same feature space but have different data samples. Each participant has a complete record for their subjects but covers different subjects.

┌──────────────────────────────────────────────────────────────┐
│                    Central Aggregator                          │
│               (aggregates model updates only)                 │
│                                                                │
│  Global Model = Aggregate(Local_1, Local_2, ..., Local_K)    │
└─────────────┬──────────────┬──────────────┬──────────────────┘
              │              │              │
    ┌─────────▼────┐ ┌──────▼──────┐ ┌────▼──────────┐
    │ Hospital A   │ │ Hospital B  │ │ Hospital C    │
    │ 5,000 pts    │ │ 8,000 pts   │ │ 3,000 pts     │
    │ Same features│ │ Same features│ │ Same features │
    │ Train locally│ │ Train locally│ │ Train locally │
    └──────────────┘ └─────────────┘ └───────────────┘

Use case: Multiple hospitals training a diagnostic model; each hospital has complete patient records but different patients.

Vertical Federated Learning

Participants share the same data subjects but have different features. Features are distributed across participants.

┌──────────────────────────────────────────────────────────────┐
│                    Coordination Server                         │
│         (aligns features without exposing raw data)           │
└─────────────┬──────────────┬──────────────┬──────────────────┘
              │              │              │
    ┌─────────▼────┐ ┌──────▼──────┐ ┌────▼──────────┐
    │ Bank         │ │ Insurer     │ │ Retailer      │
    │ Financial    │ │ Claims      │ │ Purchase      │
    │ features     │ │ features    │ │ features      │
    │ Same users   │ │ Same users  │ │ Same users    │
    └──────────────┘ └─────────────┘ └───────────────┘

Use case: Credit scoring where a bank has financial data, an insurer has claims history, and a retailer has purchase behavior — all for overlapping customers.

Aggregation Strategies

FedAvg (Federated Averaging)

The foundational FL algorithm (McMahan et al., 2017). Each participant trains for multiple local epochs, then the aggregator averages the model weights proportional to each participant's dataset size.

For each communication round t:
  1. Server sends global model w_t to selected participants
  2. Each participant k trains locally for E epochs on their data:
     w_k = LocalSGD(w_t, data_k, E epochs, learning_rate η)
  3. Server aggregates:
     w_{t+1} = Σ (n_k / n) * w_k
     where n_k = participant k's sample count, n = total samples
ParameterRecommended RangeImpact
Local epochs (E)1-5More epochs = less communication, but higher divergence risk
Participation rate10-100% per roundHigher = better convergence, more communication
Learning rate (η)0.01-0.1Standard SGD tuning applies
Communication rounds50-500Depends on data heterogeneity and model complexity

FedProx (Federated Proximal)

Extension of FedAvg for heterogeneous settings. Adds a proximal term to the local objective to limit how far local models drift from the global model. Suitable when participants have non-IID (non-independently and identically distributed) data.

Local objective for participant k:
  minimize F_k(w) + (μ/2) * ||w - w_t||^2

  where μ controls the strength of the proximal regularization
ScenarioFedAvg PerformanceFedProx PerformanceRecommendation
IID data across participantsGoodGoodFedAvg (simpler)
Mild non-IID (label skew)ModerateGoodFedProx (μ=0.01)
Severe non-IID (feature shift)PoorModerateFedProx (μ=0.1) + larger participation
Participants with varying computeUnstableStableFedProx (handles partial work)

Privacy Guarantees

Threat Model

ThreatDescriptionMitigation
Gradient inversionAdversary reconstructs training data from shared gradientsSecure aggregation + differential privacy
Membership inferenceAdversary determines if a specific record was in training dataDifferential privacy
Model inversionAdversary recovers sensitive features from the trained modelDifferential privacy + access control on model
Free-rider attackParticipant contributes noise instead of genuine updatesContribution verification (FoolsGold, RFFL)
Poisoning attackMalicious participant corrupts the global modelByzantine-robust aggregation (Krum, trimmed mean)

Secure Aggregation

Secure aggregation ensures the server sees only the sum of all participants' updates, not individual updates. Implemented using:

  1. Pairwise masking (Bonawitz et al., 2017) — Each pair of participants generates a shared random mask. Masks cancel out in the sum, but individual updates remain hidden.
  2. Threshold secret sharing — Each participant secret-shares their update; the server reconstructs only the aggregate.
  3. Homomorphic encryption — Participants encrypt updates; server aggregates ciphertexts.

Differential Privacy in FL

Adding calibrated noise to model updates before sharing provides a formal privacy guarantee:

DP-FedAvg:
  1. Each participant clips gradients: ||g_k|| ≤ C (sensitivity bounding)
  2. Each participant adds Gaussian noise: g_k' = g_k + N(0, σ²·C²·I)
  3. Server aggregates noised updates: g_agg = (1/K) Σ g_k'
  4. Privacy accounting: track cumulative (ε, δ) via Rényi DP composition

Privacy budget for Prism Data Systems AG FL deployment:

ParameterValueJustification
Clipping norm (C)1.0Standard for gradient clipping in DP-SGD
Noise multiplier (σ)1.1Provides (ε=3, δ=1e-5) per training run with 500 rounds
Target epsilon (ε)3.0Moderate privacy for non-special-category data
Target delta (δ)1e-5Standard for n ≈ 316,000 total records
Composition methodRényi DPTighter composition bounds than basic composition

Communication Efficiency

TechniqueCompression RatioAccuracy ImpactDescription
Gradient quantization8-32xMinimalReduce gradient precision from 32-bit to 8-bit or lower
Top-k sparsification10-100xModerateTransmit only the k largest gradient components
Federated dropout2-10xMinimalEach participant trains a random submodel
Gradient compression (SignSGD)32xModerateTransmit only the sign of each gradient component
Model distillationVariableModerateParticipants share soft predictions instead of gradients

Implementation Workflow

  1. Define the ML task — Specify the model architecture, training objective, and evaluation metrics.

  2. Assess data distribution — Evaluate the degree of non-IID across participants. This determines the aggregation strategy (FedAvg for IID, FedProx for non-IID).

  3. Select privacy mechanisms — Choose secure aggregation for gradient confidentiality and differential privacy for formal guarantees. Set epsilon budget.

  4. Configure communication — Select gradient compression technique based on bandwidth constraints. Set the communication round budget.

  5. Implement local training — Deploy the local training pipeline at each participant. Implement gradient clipping and noise injection for DP.

  6. Deploy aggregation server — Deploy the central aggregator with secure aggregation protocol. Implement Byzantine-robust aggregation if untrusted participants exist.

  7. Monitor and evaluate — Track model convergence, per-participant contribution quality, privacy budget consumption, and communication overhead.

Key Regulatory References

  • GDPR Article 5(1)(c) — Data minimization (only model updates shared)
  • GDPR Article 25(1) — Data protection by design
  • GDPR Article 26 — Joint controller arrangements (FL consortium governance)
  • GDPR Chapter V — Cross-border transfers (FL reduces transfer need)
  • GDPR Article 35 — DPIA for FL involving special category data
  • EDPB Guidelines 4/2019 on Article 25 Data Protection by Design and by Default

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Implements 42 CFR Part 2 protections for substance use disorder patient records. Covers written consent requirements stricter than HIPAA, re-disclosure prohibition, court order procedures, qualified service organization agreements, and 2024 amendments aligning Part 2 with HIPAA. Keywords: 42 CFR Part 2, substance use disorder, SUD records, re-disclosure, consent, Part 2 amendments.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Guides assessment of third-country adequacy decisions under GDPR Article 45 for international data transfers. Covers the current EC adequacy decisions list, adequacy assessment criteria, partial adequacy handling, and monitoring of adequacy decision reviews. Keywords: adequacy decision, Article 45, third country, adequate protection, EC adequacy list.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Implements age-gating mechanisms for online services to restrict access based on user age. Covers hard gates versus soft gates, neutral age prompts, re-verification triggers, circumvention prevention, and regulatory requirements under GDPR, COPPA, UK Online Safety Act, and DSA. Keywords: age gate, age restriction, neutral prompt, children, online services, access control.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Evaluates and implements age estimation and verification technologies for online services. Covers facial age estimation, digital ID verification, self-declaration with risk assessment, AI-based age estimation, and the accuracy versus privacy tradeoff. Includes ICO guidance and euCONSENT framework. Keywords: age verification, age estimation, facial analysis, digital ID, children, online safety.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Preparing EU AI Act compliance documentation for high-risk AI systems. Covers Annex III classification, technical documentation under Art. 11, conformity assessment, risk management systems, and CE marking requirements. Keywords: EU AI Act, high-risk AI, Annex III, conformity assessment, CE marking.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Implements GDPR Art. 22 automated decision-making and AI Act Art. 14 human oversight requirements for AI systems. Covers identification of solely automated decisions, meaningful human intervention design, logic explanation mechanisms, and contestation procedures. Keywords: Art. 22, automated decision, human oversight, AI Act, profiling, contestation.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

mukul975 のスキルをすべて見る

このスキルの問題を報告する